Merge branch 'master' of github.com:cypress-io/cypress-monorepo

This commit is contained in:
Chris Breiding
2017-05-15 08:58:52 -04:00
128 changed files with 2184 additions and 1533 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ const filterDirsByCmd = (dirs, cmd) => {
default:
return dirs.filter((dir) => {
const packageJson = require(path.resolve(dir, 'package'))
return !!packageJson.scripts[cmd]
return !!packageJson.scripts && !!packageJson.scripts[cmd]
})
}
}
+1
View File
@@ -0,0 +1 @@
module.exports = require("coffee-script")
+7
View File
@@ -0,0 +1,7 @@
{
"name": "coffee",
"main": "index.js",
"dependencies": {
"coffee-script": "1.12.5"
}
}
+17
View File
@@ -0,0 +1,17 @@
require("coffee-script/register")
// using hack found here to prevent problems with
// cypress coffee script being replaced by modules which
// use coffee-script/register
// https://github.com/abresas/register-coffee-coverage/blob/master/index.js
const loader = require.extensions[".coffee"]
Object.defineProperty(require.extensions, ".coffee", {
get () {
return loader
},
set () {
return loader
},
})
-1
View File
@@ -1 +0,0 @@
6.5.0
+2 -1
View File
@@ -11,7 +11,8 @@
"watch-dev": "zunder watch",
"clean": "zunder clean",
"clean-deps": "rm -rf node_modules",
"clean-all": "npm run clean && npm run clean-deps"
"clean-all": "npm run clean && npm run clean-deps",
"lint": "eslint --fix lib/*.js src/*.js* src/**/*.js* "
},
"repository": {
"type": "git",
+6
View File
@@ -19,6 +19,12 @@ The desktop GUI has the following responsibilities:
## Development
### Lint
```bash
npm run lint
```
### Building
#### For development
+2 -3
View File
@@ -11,8 +11,6 @@
},
"devDependencies": {
"@cypress/bower-kendo-ui": "0.0.2",
"@cypress/coffee-script": "0.1.2",
"@cypress/core-electron": "0.3.4",
"@cypress/icons": "0.5.2",
"angular": "^1.3.1",
"backbone": "^1.1.2",
@@ -74,5 +72,6 @@
"url-parse": "^1.1.7",
"vinyl-source-stream": "^1.1.0",
"watchify": "^3.9.0"
}
},
"dependencies": {}
}
@@ -6,7 +6,7 @@ path = require("path")
fs = require("fs")
hbs = require("hbs")
glob = require("glob")
coffee = require("coffee-script")
coffee = require("../../../../coffee")
str = require("string-to-stream")
Promise = require("bluebird")
xhrs = require("../../../../app/lib/controllers/xhrs")
-1
View File
@@ -1 +0,0 @@
6.5.0
+1 -1
View File
@@ -1,3 +1,3 @@
require("@cypress/coffee-script")
require("../coffee/register")
module.exports = require("./lib/electron")
+1 -2
View File
@@ -6,7 +6,7 @@
"main": "index.js",
"scripts": {
"start": "./bin/cypress-electron",
"test": "mocha --compilers coffee:@cypress/coffee-script",
"test": "mocha --compilers coffee:../coffee/register",
"postinstall": "./bin/cypress-electron --install",
"clean-deps": "rm -rf node_modules",
"clean-all": "npm run clean-deps"
@@ -31,7 +31,6 @@
"mocha": "^3.0.2"
},
"dependencies": {
"@cypress/coffee-script": "0.1.2",
"bluebird": "^3.4.1",
"electron-packager": "^7.2.0",
"fs-extra": "^0.30.0",
-1
View File
@@ -1 +0,0 @@
6.5.0
+1 -1
View File
@@ -36,4 +36,4 @@
// .then(function(){
// log.snapshot().end()
// })
// })
// })
-1
View File
@@ -1 +0,0 @@
6.5.0
+1 -1
View File
@@ -1,3 +1,3 @@
require("@cypress/coffee-script")
require("../coffee/register")
module.exports = require("./lib/extension")
-1
View File
@@ -47,7 +47,6 @@
"vinyl-source-stream": "^1.1.0"
},
"dependencies": {
"@cypress/coffee-script": "0.1.2",
"bluebird": "^3.3.5",
"lodash": "^4.11.2"
}
@@ -2,7 +2,7 @@ require("../spec_helper")
_ = require("lodash")
http = require("http")
socket = require("packages/core-socket")
socket = require("packages/socket")
Promise = require("bluebird")
background = require("../../app/background")
+1 -1
View File
@@ -1,5 +1,5 @@
test/unit
test/integration
--reporter spec
--compilers coffee:@cypress/coffee-script
--compilers coffee:../coffee/register
--recursive
-1
View File
@@ -1 +0,0 @@
6.5.0
+2 -2
View File
@@ -1,2 +1,2 @@
require("coffee-script/register")
require("./test/helpers/https_server").start(8443)
require("../coffee/register")
require("./test/helpers/https_server").start(8443)
+1 -1
View File
@@ -1,3 +1,3 @@
require("@cypress/coffee-script")
require("../coffee/register")
module.exports = require("./lib/proxy")
-1
View File
@@ -35,7 +35,6 @@
"supertest-as-promised": "^3.1.0"
},
"dependencies": {
"@cypress/coffee-script": "0.1.2",
"bluebird": "^3.4.0",
"fs-extra": "^0.30.0",
"node-forge": "^0.6.39",
+1 -1
View File
@@ -1,5 +1,5 @@
test/unit
test/integration
--reporter spec
--compilers coffee:@cypress/coffee-script
--compilers coffee:../coffee/register
--recursive
-1
View File
@@ -1 +0,0 @@
6.5.0
+8
View File
@@ -1,5 +1,13 @@
# Cypress Core Launcher
## Debugging
Uses [debug](https://github.com/visionmedia/debug#readme)
to output debug log messages. To turn on, use
```sh
DEBUG=cypress:launcher npm run build-and-test
```
## Changelog
+14
View File
@@ -0,0 +1,14 @@
// all common type definition for this module
type NotInstalledError = Error & {notInstalled: boolean}
type BrowserNotFoundError = Error & {specificBrowserNotFound: boolean}
interface ExtraLauncherMethods {
update: Function,
detect: Function
}
type LauncherLaunch = (browsers?: any[]) => Promise<any>
type LauncherApi = LauncherLaunch & ExtraLauncherMethods
+2 -3
View File
@@ -1,3 +1,2 @@
require("@cypress/coffee-script")
module.exports = require("./lib/launcher.coffee")
// @ts-check
module.exports = require("./lib/launcher")
+25
View File
@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var log_1 = require("./log");
var lodash_1 = require("lodash");
var cp = require("child_process");
var browserNotFoundErr = function (browsers, name) {
var available = lodash_1.map(browsers, 'name').join(', ');
var err = new Error("Browser: '" + name + "' not found. Available browsers are: [" + available + "]");
err.specificBrowserNotFound = true;
return err;
};
/** starts a browser by name and opens URL if given one */
function launch(browsers, name, url, args) {
if (args === void 0) { args = []; }
log_1.log('launching browser %s to open %s', name, url);
var browser = lodash_1.find(browsers, { name: name });
if (!browser) {
throw browserNotFoundErr(browsers, name);
}
if (url) {
args.unshift(url);
}
return cp.spawn(browser.path, args, { stdio: 'ignore' });
}
exports.launch = launch;
+22
View File
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = require("./util");
var path = require("path");
var Promise = require("bluebird");
var canary = {
version: function (p) {
return util_1.parse(p, 'KSVersion');
},
path: function () { return util_1.find('com.google.Chrome.canary'); },
get: function (executable) {
var _this = this;
return this.path()
.then(function (p) {
return Promise.props({
path: path.join(p, executable),
version: _this.version(p)
});
});
}
};
exports.default = canary;
+26
View File
@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var log_1 = require("../log");
var util_1 = require("./util");
var path = require("path");
var Promise = require("bluebird");
var chrome = {
version: function (p) {
return util_1.parse(p, 'KSVersion');
},
path: function () {
return util_1.find('com.google.Chrome');
},
get: function (executable) {
var _this = this;
log_1.log('Looking for Chrome %s', executable);
return this.path()
.then(function (p) {
return Promise.props({
path: path.join(p, executable),
version: _this.version(p)
});
});
}
};
exports.default = chrome;
+24
View File
@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = require("./util");
var path = require("path");
var Promise = require("bluebird");
var chromium = {
version: function (p) {
return util_1.parse(p, 'CFBundleShortVersionString');
},
path: function () {
return util_1.find('org.chromium.Chromium');
},
get: function (executable) {
var _this = this;
return this.path()
.then(function (p) {
return Promise.props({
path: path.join(p, executable),
version: _this.version(p)
});
});
}
};
exports.default = chromium;
+11
View File
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var canary_1 = require("./canary");
var chrome_1 = require("./chrome");
var chromium_1 = require("./chromium");
var browsers = {
chrome: chrome_1.default,
canary: canary_1.default,
chromium: chromium_1.default
};
exports.default = browsers;
+37
View File
@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var log_1 = require("../log");
var execa = require("execa");
var fs = require("fs-extra");
var path = require("path");
var plist = require("plist");
function parse(p, prop) {
var pl = path.join(p, 'Contents', 'Info.plist');
return fs.readFile(pl, 'utf8')
.then(function (str) { return plist.parse(str); })
.then(function (x) { return x[prop]; })
.catch(function (e) {
var msg = "Info.plist not found: " + pl + "\n " + e.message;
var err = new Error(msg);
err.notInstalled = true;
throw err;
});
}
exports.parse = parse;
function find(id) {
var cmd = "mdfind 'kMDItemCFBundleIdentifier==\"" + id + "\"' | head -1";
log_1.log('looking for bundle id %s using command: %s', id, cmd);
return execa.shell(cmd)
.then(function (result) { return result.stdout; })
.then(function (str) {
log_1.log('found %s at %s', id, str);
return str;
})
.catch(function () {
log_1.log('could not find %s', id);
var err = new Error("Browser not installed: " + id);
err.notInstalled = true;
throw err;
});
}
exports.find = find;
+71
View File
@@ -0,0 +1,71 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var linux_1 = require("./linux");
var darwin_1 = require("./darwin");
var log_1 = require("./log");
var _ = require("lodash");
var os = require("os");
var Promise = require("bluebird");
var browsers = [
{
name: 'chrome',
re: /Google Chrome (\S+)/,
profile: true,
binary: 'google-chrome',
executable: 'Contents/MacOS/Google Chrome'
}, {
name: 'chromium',
re: /Chromium (\S+)/,
profile: true,
binary: 'chromium-browser',
executable: 'Contents/MacOS/Chromium'
}, {
name: 'canary',
re: /Google Chrome Canary (\S+)/,
profile: true,
binary: 'google-chrome-canary',
executable: 'Contents/MacOS/Google Chrome Canary'
}
];
var setMajorVersion = function (obj) {
obj.majorVersion = obj.version.split('.')[0];
log_1.log('browser %s version %s major version %s', obj.name, obj.version, obj.majorVersion);
return obj;
};
function lookup(platform, obj) {
log_1.log('looking up %s on %s platform', obj.name, platform);
switch (platform) {
case 'darwin':
var fn = darwin_1.default[obj.name];
if (fn) {
return fn.get(obj.executable);
}
var err = new Error("Browser not installed: " + obj.name);
err.notInstalled = true;
return Promise.reject(err);
case 'linux':
return linux_1.linuxBrowser.get(obj.binary, obj.re);
}
}
function checkOneBrowser(browser) {
var platform = os.platform();
return lookup(platform, browser)
.then(function (props) {
return _.chain({})
.extend(browser, props)
.pick('name', 'type', 'version', 'path')
.value();
})
.then(setMajorVersion)
.catch(function (err) {
if (err.notInstalled) {
log_1.log('browser %s not installed', browser.name);
return false;
}
throw err;
});
}
module.exports = function () {
return Promise.map(browsers, checkOneBrowser)
.then(_.compact);
};
+34
View File
@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var fs_extra_1 = require("fs-extra");
var browsers_1 = require("./browsers");
var Promise = require('bluebird');
var detect = require('./detect');
var missingConfig = function () {
return Promise.reject(new Error('You must provide a path to a config file.'));
};
var wrap = function (all) { return ({
launch: function (name, url, args) {
if (args === void 0) { args = []; }
return browsers_1.launch(all, name, url, args);
}
}); };
var init = function (browsers) {
return browsers ? wrap(browsers) : detect().then(wrap);
};
var api = init;
var update = function (pathToConfig) {
if (!pathToConfig) {
return missingConfig();
}
// detect the browsers and set the config
var saveBrowsers = function (browers) {
return fs_extra_1.writeJson(pathToConfig, browers, { spaces: 2 });
};
return detect()
.then(saveBrowsers);
};
// extend "api" with a few utility methods for convenience
api.update = update;
api.detect = detect;
module.exports = api;
+29
View File
@@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var cp = require("child_process");
var Promise = require("bluebird");
var execAsync = Promise.promisify(cp.exec);
var notInstalledErr = function (name) {
var err = new Error("Browser not installed: " + name);
err.notInstalled = true;
throw err;
};
exports.linuxBrowser = {
get: function (binary, re) {
return execAsync(binary + " --version")
.call('trim')
.then(function (stdout) {
var m = re.exec(stdout);
if (m) {
return {
path: binary,
version: m[1]
};
}
else {
notInstalledErr(binary);
}
})
.catch(function () { return notInstalledErr(binary); });
}
};
+4
View File
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var debug = require("debug");
exports.log = debug('cypress:launcher');
+19 -4
View File
@@ -3,9 +3,15 @@
"version": "0.1.1",
"description": "Internal lib for spawning browser processes",
"main": "index.js",
"types": "./index.d.ts",
"scripts": {
"clean-deps": "rm -rf node_modules",
"clean-all": "npm run clean-deps"
"clean-all": "npm run clean-deps",
"lint": "tslint --fix --format stylish src/**/*.ts",
"build": "tsc",
"prebuild": "npm run lint",
"test": "mocha --opts test/mocha.opts test/unit/*spec.coffee",
"build-and-test": "npm run build && npm test"
},
"repository": {
"type": "git",
@@ -19,15 +25,24 @@
"homepage": "https://github.com/cypress-io/cypress-core-launcher#readme",
"devDependencies": {
"@cypress/releaser": "0.1.12",
"@types/bluebird": "^3.5.3",
"@types/debug": "0.0.29",
"@types/fs-extra": "3.0.0",
"@types/lodash": "^4.14.64",
"@types/node": "^7.0.18",
"chai": "^3.5.0",
"mocha": "^2.4.5",
"sinon": "^1.17.3",
"sinon-chai": "^2.8.0"
"sinon-chai": "^2.8.0",
"tslint": "^5.2.0",
"tslint-config-standard": "^5.0.2",
"typescript": "^2.3.2"
},
"dependencies": {
"@cypress/coffee-script": "0.1.2",
"bluebird": "^3.3.5",
"fs-extra": "^0.28.0",
"debug": "^2.6.6",
"execa": "^0.6.3",
"fs-extra": "^3.0.0",
"lodash": "^4.11.1",
"plist": "^1.2.0"
}
+34
View File
@@ -0,0 +1,34 @@
import {log} from './log'
import {find, map} from 'lodash'
import cp = require('child_process')
const browserNotFoundErr = (browsers, name: string): BrowserNotFoundError => {
const available = map(browsers, 'name').join(', ')
const err: BrowserNotFoundError
= new Error(`Browser: '${name}' not found. Available browsers are: [${available}]`) as BrowserNotFoundError
err.specificBrowserNotFound = true
return err
}
type FoundBrowser = {
name: string,
path: string
}
/** starts a browser by name and opens URL if given one */
export function launch (browsers:FoundBrowser[],
name:string, url?:string, args = []) {
log('launching browser %s to open %s', name, url)
const browser = find(browsers, {name})
if (!browser) {
throw browserNotFoundErr(browsers, name)
}
if (url) {
args.unshift(url)
}
return cp.spawn(browser.path, args, {stdio: 'ignore'})
}
+22
View File
@@ -0,0 +1,22 @@
import {parse, find} from './util'
import path = require('path')
import Promise = require('bluebird')
const canary = {
version: (p) =>
parse(p, 'KSVersion'),
path: () => find('com.google.Chrome.canary'),
get (executable) {
return this.path()
.then (p => {
return Promise.props({
path: path.join(p, executable),
version: this.version(p)
})
})
}
}
export default canary
+28
View File
@@ -0,0 +1,28 @@
import {log} from '../log'
import {parse, find} from './util'
import path = require('path')
import Promise = require('bluebird')
const chrome = {
version (p) {
return parse(p, 'KSVersion')
},
path () {
return find('com.google.Chrome')
},
get (executable) {
log('Looking for Chrome %s', executable)
return this.path()
.then(p => {
return Promise.props({
path: path.join(p, executable),
version: this.version(p)
})
})
}
}
export default chrome
+25
View File
@@ -0,0 +1,25 @@
import {find, parse} from './util'
import path = require('path')
import Promise = require('bluebird')
const chromium = {
version (p) {
return parse(p, 'CFBundleShortVersionString')
},
path () {
return find('org.chromium.Chromium')
},
get (executable) {
return this.path()
.then(p =>
Promise.props({
path: path.join(p, executable),
version: this.version(p)
})
)
}
}
export default chromium
+11
View File
@@ -0,0 +1,11 @@
import canary from './canary'
import chrome from './chrome'
import chromium from './chromium'
const browsers = {
chrome,
canary,
chromium
}
export default browsers
+37
View File
@@ -0,0 +1,37 @@
import {log} from '../log'
import execa = require('execa')
import fs = require('fs-extra')
import path = require('path')
import plist = require('plist')
export function parse (p, prop) {
const pl = path.join(p, 'Contents', 'Info.plist')
return fs.readFile(pl, 'utf8')
.then(str => plist.parse(str))
.then(x => x[prop])
.catch((e) => {
const msg = `Info.plist not found: ${pl}
${e.message}`
const err = new Error(msg) as NotInstalledError
err.notInstalled = true
throw err
})
}
export function find (id) {
const cmd = `mdfind 'kMDItemCFBundleIdentifier=="${id}"' | head -1`
log('looking for bundle id %s using command: %s', id, cmd)
return execa.shell(cmd)
.then(result => result.stdout)
.then(str => {
log('found %s at %s', id, str)
return str
})
.catch(() => {
log('could not find %s', id)
const err = new Error(`Browser not installed: ${id}`) as NotInstalledError
err.notInstalled = true
throw err
})
}
+86
View File
@@ -0,0 +1,86 @@
import {linuxBrowser} from './linux'
import darwin from './darwin'
import {log} from './log'
import _ = require('lodash')
import os = require('os')
import Promise = require('bluebird')
type Browser = {
name: string,
re: RegExp,
profile: boolean,
binary: string,
executable: string
}
const browsers:Browser[] = [
{
name: 'chrome',
re: /Google Chrome (\S+)/,
profile: true,
binary: 'google-chrome',
executable: 'Contents/MacOS/Google Chrome'
},{
name: 'chromium',
re: /Chromium (\S+)/,
profile: true,
binary: 'chromium-browser',
executable: 'Contents/MacOS/Chromium'
},{
name: 'canary',
re: /Google Chrome Canary (\S+)/,
profile: true,
binary: 'google-chrome-canary',
executable: 'Contents/MacOS/Google Chrome Canary'
}
]
const setMajorVersion = (obj) => {
obj.majorVersion = obj.version.split('.')[0]
log('browser %s version %s major version %s',
obj.name, obj.version, obj.majorVersion)
return obj
}
function lookup (platform, obj) {
log('looking up %s on %s platform', obj.name, platform)
switch (platform) {
case 'darwin':
const fn = darwin[obj.name]
if (fn) {
return fn.get(obj.executable)
}
const err: NotInstalledError =
new Error(`Browser not installed: ${obj.name}`) as NotInstalledError
err.notInstalled = true
return Promise.reject(err)
case 'linux':
return linuxBrowser.get(obj.binary, obj.re)
// TODO handle default case?
}
}
function checkOneBrowser(browser:Browser) {
const platform = os.platform()
return lookup(platform, browser)
.then(props => {
return _.chain({})
.extend(browser, props)
.pick('name', 'type', 'version', 'path')
.value()
})
.then(setMajorVersion)
.catch(err => {
if (err.notInstalled) {
log('browser %s not installed', browser.name)
return false
}
throw err
})
}
module.exports = () => {
return Promise.map(browsers, checkOneBrowser)
.then(_.compact)
}
+37
View File
@@ -0,0 +1,37 @@
import {writeJson} from 'fs-extra'
import {launch} from './browsers'
const Promise = require('bluebird')
const detect = require('./detect')
const missingConfig = () =>
Promise.reject(new Error('You must provide a path to a config file.'))
const wrap = all => ({
launch: (name, url, args = []) =>
launch(all, name, url, args)
})
const init = browsers =>
browsers ? wrap(browsers) : detect().then(wrap)
const api: LauncherApi = init as LauncherApi
const update = (pathToConfig) => {
if (!pathToConfig) {
return missingConfig()
}
// detect the browsers and set the config
const saveBrowsers = browers =>
writeJson(pathToConfig, browers, {spaces: 2})
return detect()
.then(saveBrowsers)
}
// extend "api" with a few utility methods for convenience
api.update = update
api.detect = detect
module.exports = api
+29
View File
@@ -0,0 +1,29 @@
import cp = require('child_process')
import Promise = require('bluebird')
const execAsync = Promise.promisify(cp.exec)
const notInstalledErr = (name: string) => {
const err: NotInstalledError = new Error(`Browser not installed: ${name}`) as NotInstalledError
err.notInstalled = true
throw err
}
export const linuxBrowser = {
get: (binary, re): Promise<any> => {
return execAsync(`${binary} --version`)
.call('trim')
.then (stdout => {
const m = re.exec(stdout)
if (m) {
return {
path: binary,
version: m[1]
}
} else {
notInstalledErr(binary)
}
})
.catch(() => notInstalledErr(binary))
}
}
+3
View File
@@ -0,0 +1,3 @@
import * as debug from 'debug'
export const log = debug('cypress:launcher')
+1 -1
View File
@@ -1,4 +1,4 @@
test/unit
--reporter spec
--compilers coffee:@cypress/coffee-script
--compilers coffee:../coffee/register
--recursive
@@ -0,0 +1,7 @@
require("../spec_helper")
detect = require('../../lib/detect')
describe "browser detection", ->
it 'detects available browsers', ->
detect().then (browsers) ->
expect(browsers).to.be.an.array
@@ -0,0 +1,13 @@
require("../spec_helper")
launcher = require('../..')
describe "launcher", ->
it 'returns a function', ->
expect(launcher).to.be.a.function
it 'has update method', ->
expect(launcher.update).to.be.a.function
it 'returns api with launch method', ->
launcher().then (api) ->
expect(api.launch).to.be.a.function
+57
View File
@@ -0,0 +1,57 @@
{
"compilerOptions": {
/* Basic Options */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */
// "lib": [], /* Specify library files to be included in the compilation: */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
// "declaration": true, /* Generates corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "./lib", /* Redirect output structure to the directory. */
// "rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "removeComments": true, /* Do not emit comments to output. */
// "noEmit": true, /* Do not emit outputs. */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
/* Strict Type-Checking Options */
// "strict": true, /* Enable all strict type-checking options. */
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* Enable strict null checks. */
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
/* Additional Checks */
"noUnusedLocals": true, /* Report errors on unused locals. */
"noUnusedParameters": true, /* Report errors on unused parameters. */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
/* Module Resolution Options */
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
"baseUrl": "./src" /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [] /* List of folders to include type definitions from. */
// "types": [] /* Type declaration files to be included in compilation. */
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
/* Source Map Options */
// "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
// "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
/* Experimental Options */
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
},
"include": [
"./src/*.ts",
"./index.d.ts"
]
}
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "tslint-config-standard"
}
-1
View File
@@ -1 +0,0 @@
6.5.0
-1
View File
@@ -1 +0,0 @@
6.5.0
-1
View File
@@ -1 +0,0 @@
6.5.0
+1 -1
View File
@@ -18,7 +18,7 @@ meta = require("./meta")
pkg = require("../package.json")
konfig = require("../lib/konfig")
appData = require("../lib/util/app_data")
Fixtures = require("../spec/server/helpers/fixtures")
Fixtures = require("../test/support/helpers/fixtures")
# pkgr = Promise.promisify(pkgr)
fs = Promise.promisifyAll(fs)
+1 -1
View File
@@ -1,6 +1,6 @@
process.env.UV_THREADPOOL_SIZE = 128
require('graceful-fs').gracefulify(require('fs'))
require("@cypress/coffee-script")
require("../coffee/register")
require && require.extensions && delete require.extensions[".litcoffee"]
require && require.extensions && delete require.extensions[".coffee.md"]
require("./lib/cypress").start(process.argv)
+1 -1
View File
@@ -2,7 +2,7 @@ _ = require("lodash")
fs = require("fs-extra")
path = require("path")
check = require("syntax-error")
coffee = require("coffee-script")
coffee = require("../../../packages/coffee")
Promise = require("bluebird")
jsonlint = require("jsonlint")
beautify = require("js-beautify").html
+2 -3
View File
@@ -37,15 +37,14 @@ class Project extends EE
throw new Error("Instantiating lib/project requires a projectRoot!")
@projectRoot = path.resolve(projectRoot)
@watchers = null
@watchers = Watchers()
@server = null
@cfg = null
@memoryCheck = null
@automation = null
open: (options = {}) ->
@watchers = Watchers()
@server = Server(@watchers)
@server = Server(@watchers)
_.defaults options, {
report: false
+1 -1
View File
@@ -5,7 +5,7 @@ path = require("path")
repl = require("repl")
history = require("repl.history")
browsers = require("./browsers")
Fixtures = require("../spec/server/helpers/fixtures")
Fixtures = require("../test/support/helpers/fixtures")
replServer = repl.start({
prompt: "> "
+1 -1
View File
@@ -3,7 +3,6 @@ fs = require("fs-extra")
EE = require("events")
path = require("path")
through = require("through")
cjsxify = require("cjsxify")
Promise = require("bluebird")
babelify = require("babelify")
watchify = require("watchify")
@@ -13,6 +12,7 @@ presetLatest = require("babel-preset-latest")
stringStream = require("string-to-stream")
pluginAddModuleExports = require("babel-plugin-add-module-exports")
sanitize = require("sanitize-filename")
cjsxify = require("./cjsxify")
appData = require("./app_data")
fs = Promise.promisifyAll(fs)
+11
View File
@@ -0,0 +1,11 @@
## wrapper for cjsxify to prevent coffee script from rewriting Error.prepareStackTrace
## hold onto the original
prepareStackTrace = Error.prepareStackTrace
cjsxify = require("cjsxify")
## restore
Error.prepareStackTrace = prepareStackTrace
module.exports = cjsxify
+13 -14
View File
@@ -13,19 +13,19 @@
"clean-deps": "rm -rf node_modules",
"deploy": "gulp deploy",
"release": "gulp release",
"test": "./spec/server/helpers/watch test-once",
"test-once": "./spec/server/helpers/run",
"test-unit": "./spec/server/helpers/watch test-unit-once",
"test-unit-once": "./spec/server/helpers/run spec/server/unit",
"test-integration": "./spec/server/helpers/watch test-integration-once",
"test-integration-once": "./spec/server/helpers/run spec/server/integration",
"test-e2e": "./spec/server/helpers/watch test-e2e-once",
"test-e2e-once": "./spec/server/helpers/run spec/server/e2e",
"test-e2e-chrome": "./spec/server/helpers/watch test-e2e-chrome-once",
"test-e2e-chrome-once": "./spec/server/helpers/run e2e chrome",
"test-cov": "NODE_COVERAGE=true NODE_ENV=test CYPRESS_ENV=test BLUEBIRD_DEBUG=1 xvfb-maybe istanbul cover node_modules/.bin/_mocha -- --opts ./spec/server/mocha.opts",
"test": "./test/support/helpers/watch test-once",
"test-once": "./test/support/helpers/run",
"test-unit": "./test/support/helpers/watch test-unit-once",
"test-unit-once": "./test/support/helpers/run test/unit",
"test-integration": "./test/support/helpers/watch test-integration-once",
"test-integration-once": "./test/support/helpers/run test/integration",
"test-e2e": "./test/support/helpers/watch test-e2e-once",
"test-e2e-once": "./test/support/helpers/run test/e2e",
"test-e2e-chrome": "./test/support/helpers/watch test-e2e-chrome-once",
"test-e2e-chrome-once": "./test/support/helpers/run e2e chrome",
"test-cov": "NODE_COVERAGE=true NODE_ENV=test CYPRESS_ENV=test BLUEBIRD_DEBUG=1 xvfb-maybe istanbul cover node_modules/.bin/_mocha -- --opts ./test/support/mocha.opts",
"test-cov-process": "NODE_COVERAGE=true NODE_ENV=test CYPRESS_ENV=test BLUEBIRD_DEBUG=1 istanbul cover --include-pid",
"test-debug": "NODE_ENV=test NODE_DEBUG=request CYPRESS_ENV=test BLUEBIRD_DEBUG=1 DEBUG=nock.*,-nock.common,socket.io:* node-debug --hidden='(node_modules|bower_components)' --no-preload _mocha --opts spec/server/mocha.opts --watch",
"test-debug": "NODE_ENV=test NODE_DEBUG=request CYPRESS_ENV=test BLUEBIRD_DEBUG=1 DEBUG=nock.*,-nock.common,socket.io:* node-debug --hidden='(node_modules|bower_components)' --no-preload _mocha --opts test/support/mocha.opts --watch",
"codecov": "codecov",
"coveralls": "cat ./coverage/lcov.info | coveralls"
},
@@ -72,7 +72,6 @@
"xvfb-maybe": "cypress-io/xvfb-maybe#c4a810c42d603949cd63b8cf245f6c239331d370"
},
"dependencies": {
"@cypress/coffee-script": "0.1.2",
"@cypress/icons": "0.5.2",
"@ffmpeg-installer/ffmpeg": "1.0.3",
"ansi_up": "^1.3.0",
@@ -152,7 +151,7 @@
"send": "^0.14.1",
"server-destroy": "1.0.1",
"signal-exit": "^3.0.2",
"sinon": "cypress-io/sinon#bd2fc5665a7f83acd9931bc9aca212fd21bf3ef2",
"sinon": "1.17.7",
"sinon-as-promised": "3.0.1",
"sinon-chai": "cypress-io/sinon-chai#84d1085cac68f85c838471577e9d8cc811ca325d",
"string-to-stream": "^1.0.1",
+1 -1
View File
@@ -1,2 +1,2 @@
require("coffee-script/register")
require("../coffee/register")
require("./lib/repl")
@@ -1,4 +1,4 @@
e2e = require("../helpers/e2e")
e2e = require("../support/helpers/e2e")
onServer = (app) ->
app.get "/app/html", (req, res) ->
@@ -1,5 +1,5 @@
e2e = require("../helpers/e2e")
Fixtures = require("../helpers/fixtures")
e2e = require("../support/helpers/e2e")
Fixtures = require("../support/helpers/fixtures")
e2ePath = Fixtures.projectPath("e2e")
@@ -1,5 +1,5 @@
Fixtures = require("../helpers/fixtures")
e2e = require("../helpers/e2e")
Fixtures = require("../support/helpers/fixtures")
e2e = require("../support/helpers/e2e")
bustedSupportFile = Fixtures.projectPath("busted-support-file")
+2 -2
View File
@@ -1,8 +1,8 @@
fs = require("fs")
path = require("path")
express = require("express")
Fixtures = require("../helpers/fixtures")
e2e = require("../helpers/e2e")
Fixtures = require("../support/helpers/fixtures")
e2e = require("../support/helpers/e2e")
replacerRe = /(<h1>)\w+(<\/h1>)/
@@ -1,5 +1,5 @@
Fixtures = require("../helpers/fixtures")
e2e = require("../helpers/e2e")
Fixtures = require("../support/helpers/fixtures")
e2e = require("../support/helpers/e2e")
e2ePath = Fixtures.projectPath("e2e")
@@ -1,4 +1,4 @@
e2e = require("../helpers/e2e")
e2e = require("../support/helpers/e2e")
describe "e2e commands outside of test", ->
e2e.setup()
+1 -1
View File
@@ -1,4 +1,4 @@
e2e = require("../helpers/e2e")
e2e = require("../support/helpers/e2e")
describe "e2e config", ->
e2e.setup({
+1 -1
View File
@@ -1,6 +1,6 @@
moment = require("moment")
parser = require("cookie-parser")
e2e = require("../helpers/e2e")
e2e = require("../support/helpers/e2e")
onServer = (app) ->
app.use(parser())
@@ -1,4 +1,4 @@
e2e = require("../helpers/e2e")
e2e = require("../support/helpers/e2e")
describe "e2e ended early", ->
e2e.setup()
+1 -1
View File
@@ -1,4 +1,4 @@
e2e = require("../helpers/e2e")
e2e = require("../support/helpers/e2e")
describe "e2e files", ->
@@ -1,4 +1,4 @@
e2e = require("../helpers/e2e")
e2e = require("../support/helpers/e2e")
describe "e2e fixtures", ->
e2e.setup()
@@ -1,4 +1,4 @@
e2e = require("../helpers/e2e")
e2e = require("../support/helpers/e2e")
describe "e2e form submissions", ->
e2e.setup()
+1 -1
View File
@@ -1,4 +1,4 @@
e2e = require("../helpers/e2e")
e2e = require("../support/helpers/e2e")
onServer = (app) ->
app.get "/first", (req, res) ->
+2 -2
View File
@@ -1,8 +1,8 @@
fs = require("fs")
path = require("path")
bodyParser = require("body-parser")
Fixtures = require("../helpers/fixtures")
e2e = require("../helpers/e2e")
Fixtures = require("../support/helpers/fixtures")
e2e = require("../support/helpers/e2e")
e2ePath = Fixtures.projectPath("e2e")
+1 -1
View File
@@ -1,4 +1,4 @@
e2e = require("../helpers/e2e")
e2e = require("../support/helpers/e2e")
describe "e2e images", ->
e2e.setup({
@@ -1,6 +1,6 @@
fs = require("fs-extra")
Fixtures = require("../helpers/fixtures")
e2e = require("../helpers/e2e")
Fixtures = require("../support/helpers/fixtures")
e2e = require("../support/helpers/e2e")
e2ePath = Fixtures.projectPath("e2e")
@@ -1,4 +1,4 @@
e2e = require("../helpers/e2e")
e2e = require("../support/helpers/e2e")
describe "e2e issue 173", ->
e2e.setup()
@@ -1,4 +1,4 @@
e2e = require("../helpers/e2e")
e2e = require("../support/helpers/e2e")
describe "e2e js error handling", ->
e2e.setup({
@@ -1,4 +1,4 @@
e2e = require("../helpers/e2e")
e2e = require("../support/helpers/e2e")
describe "e2e keyboard", ->
e2e.setup()
@@ -1,8 +1,8 @@
fs = require("fs-extra")
path = require("path")
Promise = require("bluebird")
Fixtures = require("../helpers/fixtures")
e2e = require("../helpers/e2e")
Fixtures = require("../support/helpers/fixtures")
e2e = require("../support/helpers/e2e")
fs = Promise.promisifyAll(fs)
+1 -1
View File
@@ -1,4 +1,4 @@
e2e = require("../helpers/e2e")
e2e = require("../support/helpers/e2e")
describe "e2e only spec", ->
e2e.setup()
@@ -1,5 +1,5 @@
bodyParser = require("body-parser")
e2e = require("../helpers/e2e")
e2e = require("../support/helpers/e2e")
count = 0
@@ -1,6 +1,6 @@
cp = require("child_process")
e2e = require("../helpers/e2e")
Fixtures = require("../helpers/fixtures")
e2e = require("../support/helpers/e2e")
Fixtures = require("../support/helpers/fixtures")
fs = require("fs-extra")
path = require("path")
Promise = require("bluebird")
+1 -1
View File
@@ -1,6 +1,6 @@
bodyParser = require("body-parser")
cookieParser = require("cookie-parser")
e2e = require("../helpers/e2e")
e2e = require("../support/helpers/e2e")
counts = {
"localhost:2290": 0
@@ -3,8 +3,8 @@ fs = require("fs-extra")
path = require("path")
Promise = require("bluebird")
sizeOf = require("image-size")
Fixtures = require("../helpers/fixtures")
e2e = require("../helpers/e2e")
Fixtures = require("../support/helpers/fixtures")
e2e = require("../support/helpers/e2e")
fs = Promise.promisifyAll(fs)
sizeOf = Promise.promisify(sizeOf)
+2 -2
View File
@@ -1,5 +1,5 @@
e2e = require("../helpers/e2e")
Fixtures = require("../helpers/fixtures")
e2e = require("../support/helpers/e2e")
Fixtures = require("../support/helpers/fixtures")
e2ePath = Fixtures.projectPath("e2e")
@@ -1,7 +1,7 @@
cors = require("cors")
parser = require("cookie-parser")
session = require("express-session")
e2e = require("../helpers/e2e")
e2e = require("../support/helpers/e2e")
onServer = (app) ->
app.use(parser())
@@ -1,4 +1,4 @@
e2e = require("../helpers/e2e")
e2e = require("../support/helpers/e2e")
describe "e2e viewport", ->
e2e.setup({
+2 -2
View File
@@ -1,6 +1,6 @@
useragent = require("express-useragent")
Fixtures = require("../helpers/fixtures")
e2e = require("../helpers/e2e")
Fixtures = require("../support/helpers/fixtures")
e2e = require("../support/helpers/e2e")
onServer = (app) ->
app.get "/agent.json", (req, res) ->
@@ -1,5 +1,5 @@
_ = require("lodash")
e2e = require("../helpers/e2e")
e2e = require("../support/helpers/e2e")
onServer = (app) ->
app.get "/link", (req, res) ->
@@ -1,4 +1,4 @@
e2e = require("../helpers/e2e")
e2e = require("../support/helpers/e2e")
describe.skip "e2e window.open", ->
e2e.setup()
+1 -1
View File
@@ -1,5 +1,5 @@
bodyParser = require("body-parser")
e2e = require("../helpers/e2e")
e2e = require("../support/helpers/e2e")
onServer = (app) ->
app.use(bodyParser.json())
@@ -2,7 +2,7 @@ require("../spec_helper")
_ = require("lodash")
cp = require("child_process")
pr = require("../helpers/process")
pr = require("../support/helpers/process")
pkg = require("#{root}package.json")
anyLineWithCaret = (str) ->
@@ -8,8 +8,8 @@ http = require("http")
Promise = require("bluebird")
electron = require("electron")
inquirer = require("inquirer")
extension = require("@cypress/core-extension")
Fixtures = require("../helpers/fixtures")
Fixtures = require("../support/helpers/fixtures")
extension = require("#{root}../../packages/extension")
pkg = require("#{root}package.json")
git = require("#{root}lib/util/git")
bundle = require("#{root}lib/util/bundle")

Some files were not shown because too many files have changed in this diff Show More