mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-26 00:50:41 -05:00
add driver lib for serving driver dist
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
send = require("send")
|
||||
driver = require("../../../driver")
|
||||
|
||||
module.exports = {
|
||||
handle: (req, res) ->
|
||||
pathToFile = driver.getPathToDist(req.params[0])
|
||||
|
||||
send(req, pathToFile)
|
||||
.pipe(res)
|
||||
}
|
||||
@@ -9,6 +9,7 @@ xhrs = require("./controllers/xhrs")
|
||||
client = require("./controllers/client")
|
||||
files = require("./controllers/files")
|
||||
proxy = require("./controllers/proxy")
|
||||
driver = require("./controllers/driver")
|
||||
staticCtrl = require("./controllers/static")
|
||||
|
||||
module.exports = (app, config, request, getRemoteState, watchers, project) ->
|
||||
@@ -29,6 +30,9 @@ module.exports = (app, config, request, getRemoteState, watchers, project) ->
|
||||
app.get "/__cypress/runner/*", (req, res) ->
|
||||
runner.handle(req, res)
|
||||
|
||||
app.get "/__cypress/driver/*", (req, res) ->
|
||||
driver.handle(req, res)
|
||||
|
||||
app.get "/__cypress/static/*", (req, res) ->
|
||||
staticCtrl.handle(req, res)
|
||||
|
||||
|
||||
@@ -136,24 +136,6 @@ watchSpecs = ->
|
||||
gulp.watch "test/**/*_spec.coffee", (event) ->
|
||||
server.runSpec(event.path)
|
||||
|
||||
# gulp.task "app:img", ["vendor:img", "project:img", "project:favicon", "project:logo"]
|
||||
|
||||
# gulp.task "vendor:img", ->
|
||||
# gulp.src("node_modules/jquery-ui/themes/smoothness/images/**")
|
||||
# .pipe gulp.dest "lib/public/css/images"
|
||||
#
|
||||
# gulp.task "project:img", ->
|
||||
# gulp.src("app/img/**/*")
|
||||
# .pipe gulp.dest "lib/public/img"
|
||||
#
|
||||
# gulp.task "project:favicon", ->
|
||||
# gulp.src(cyIcons.getPathToFavicon("**/*"))
|
||||
# .pipe gulp.dest "lib/public/img"
|
||||
#
|
||||
# gulp.task "project:logo", ->
|
||||
# gulp.src cyIcons.getPathToIcon("icon_128x128@2x.png")
|
||||
# .pipe gulp.dest "lib/public/img"
|
||||
|
||||
gulp.task "app:js", ->
|
||||
compileJs()
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
module.exports = require("./lib/driver")
|
||||
@@ -0,0 +1,13 @@
|
||||
var path = require('path')
|
||||
|
||||
function dist () {
|
||||
var args = [].slice.call(arguments)
|
||||
var paths = [__dirname, '..', 'dist'].concat(args)
|
||||
return path.join.apply(path, paths)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getPathToDist: function(){
|
||||
return dist.apply(null, arguments)
|
||||
},
|
||||
}
|
||||
@@ -14,8 +14,7 @@
|
||||
<div id="app"></div>
|
||||
|
||||
<script type="text/javascript" src="/__cypress/socket.io.js"></script>
|
||||
<script type="text/javascript" src="/__cypress/static/js/vendor.js"></script>
|
||||
<script type="text/javascript" src="/__cypress/static/js/cypress.js"></script>
|
||||
<script type="text/javascript" src="/__cypress/driver/driver.js"></script>
|
||||
<script type="text/javascript" src="/__cypress/runner/runner.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
||||
Reference in New Issue
Block a user