mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-21 14:40:05 -05:00
001a310b04
* server: pass --cwd from CLI to use when resolving relative paths for various options - remove unnecessary cwd manipulation in scripts/start * server: fixes #1159, specs are normalized into an array resolved against cwd - projectPath is now normalized against cwd as well * server: move hosts out of CLI args, keep as config only * server: convert spec array to string on module API * cli: must ref root package directly * server: fixes busted specs due to cherry pick * server: temporary fix for specs being normalized into an array * server: move around spec flattening earlier * server: pass absolute path for specs * server: revert flattening hosts into config temporarily * server: add correct relative + absolute path to spec * driver: normalize spec path against project * driver: skip flaky test for now [skip ci]
41 lines
947 B
JavaScript
41 lines
947 B
JavaScript
// https://github.com/cypress-io/cypress/issues/316
|
|
|
|
const Promise = require('bluebird')
|
|
const tmp = Promise.promisifyAll(require('tmp'))
|
|
|
|
const fs = require('./fs')
|
|
const open = require('./exec/open')
|
|
const run = require('./exec/run')
|
|
const util = require('./util')
|
|
|
|
const cypressModuleApi = {
|
|
open (options = {}) {
|
|
return open.start(options)
|
|
},
|
|
|
|
run (options = {}) {
|
|
options = util.normalizeModuleOptions(options)
|
|
|
|
return tmp.fileAsync()
|
|
.then((outputPath) => {
|
|
options.outputPath = outputPath
|
|
|
|
return run.start(options)
|
|
.then((failedTests) => {
|
|
return fs.readJsonAsync(outputPath, { throws: false })
|
|
.then((output) => {
|
|
if (!output) {
|
|
return {
|
|
failures: failedTests,
|
|
message: 'Could not find Cypress test run results',
|
|
}
|
|
}
|
|
return output
|
|
})
|
|
})
|
|
})
|
|
},
|
|
}
|
|
|
|
module.exports = cypressModuleApi
|