mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-25 00:19:11 -05:00
server: upgrade glob in server to get absolute paths of specs for #118
This commit is contained in:
@@ -151,6 +151,8 @@ module.exports = {
|
||||
|
||||
setNameParts = (file) ->
|
||||
log("found test file %s", file)
|
||||
throw new Error("Cannot set parts of file from non-absolute path #{file}") if not path.isAbsolute(file)
|
||||
|
||||
{
|
||||
name: relativePathFromIntegrationFolder(file)
|
||||
path: relativePathFromProjectRoot(file)
|
||||
@@ -176,8 +178,10 @@ module.exports = {
|
||||
## ignored test files glob
|
||||
.filter(doesNotMatchAllIgnoredPatterns)
|
||||
.map(setNameParts)
|
||||
.then (arr) ->
|
||||
.then (files) ->
|
||||
log("found %d spec files", files.length)
|
||||
log(files)
|
||||
{
|
||||
integration: arr
|
||||
integration: files
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
"fs-extra": "2.1.2",
|
||||
"getos": "^2.8.2",
|
||||
"gift": "0.9.0",
|
||||
"glob": "5.0.10",
|
||||
"glob": "7.1.2",
|
||||
"graceful-fs": "^4.1.11",
|
||||
"gulp-util": "^3.0.6",
|
||||
"hbs": "4.0.0",
|
||||
|
||||
@@ -3,13 +3,38 @@ require("../spec_helper")
|
||||
Promise = require("bluebird")
|
||||
human = require("human-interval")
|
||||
path = require("path")
|
||||
R = require("ramda")
|
||||
|
||||
api = require("#{root}lib/api")
|
||||
config = require("#{root}lib/config")
|
||||
user = require("#{root}lib/user")
|
||||
filesUtil = require("#{root}lib/controllers/files")
|
||||
files = require("#{root}lib/files")
|
||||
FixturesHelper = require("#{root}/test/support/helpers/fixtures")
|
||||
filesController = require("#{root}lib/controllers/files")
|
||||
|
||||
describe "lib/controllers/files", ->
|
||||
beforeEach ->
|
||||
FixturesHelper.scaffold()
|
||||
|
||||
@todosPath = FixturesHelper.projectPath("todos")
|
||||
|
||||
config.get(@todosPath).then (cfg) =>
|
||||
@config = cfg
|
||||
|
||||
afterEach ->
|
||||
FixturesHelper.remove()
|
||||
|
||||
context "#getTestFiles", ->
|
||||
|
||||
checkFoundSpec = (foundSpec) ->
|
||||
if not path.isAbsolute(foundSpec.absolute)
|
||||
throw new Error("path to found spec should be absolute #{JSON.stringify(foundSpec)}")
|
||||
|
||||
it "returns absolute filenames", ->
|
||||
filesController
|
||||
.getTestFiles(@config)
|
||||
.then (R.prop("integration"))
|
||||
.then (R.forEach(checkFoundSpec))
|
||||
|
||||
describe "lib/files", ->
|
||||
beforeEach ->
|
||||
@@ -18,6 +43,7 @@ describe "lib/files", ->
|
||||
@todosPath = FixturesHelper.projectPath("todos")
|
||||
|
||||
config.get(@todosPath).then (cfg) =>
|
||||
@config = cfg
|
||||
{@projectRoot} = cfg
|
||||
|
||||
afterEach ->
|
||||
|
||||
Reference in New Issue
Block a user