mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-14 03:00:21 -06:00
Merge branch 'develop' into 9.0-release
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"chrome:beta": "95.0.4638.54",
|
||||
"chrome:beta": "96.0.4664.18",
|
||||
"chrome:stable": "95.0.4638.54"
|
||||
}
|
||||
|
||||
@@ -44,6 +44,11 @@
|
||||
"default": null,
|
||||
"description": "The reporter options used. Supported options depend on the reporter. See https://on.cypress.io/reporters#Reporter-Options"
|
||||
},
|
||||
"slowTestThreshold": {
|
||||
"type": "number",
|
||||
"default": 10000,
|
||||
"description": "Slow test threshold in milliseconds. Only affects the visual output of some reporters. For example, the spec reporter will display the test time in yellow if over the threshold. See https://on.cypress.io/configuration#Timeouts"
|
||||
},
|
||||
"testFiles": {
|
||||
"type": [
|
||||
"string",
|
||||
|
||||
4
cli/types/cypress-npm-api.d.ts
vendored
4
cli/types/cypress-npm-api.d.ts
vendored
@@ -91,6 +91,10 @@ declare namespace CypressCommandLine {
|
||||
* Specify mocha reporter options
|
||||
*/
|
||||
reporterOptions: any
|
||||
/**
|
||||
* Slow test threshold in milliseconds. Only affects the visual output of some reporters. For example, the spec reporter will display the test time in yellow if over the threshold.
|
||||
*/
|
||||
slowTestThreshold: number
|
||||
/**
|
||||
* Specify the specs to run
|
||||
*/
|
||||
|
||||
5
cli/types/cypress.d.ts
vendored
5
cli/types/cypress.d.ts
vendored
@@ -2577,6 +2577,11 @@ declare namespace Cypress {
|
||||
* @default "spec"
|
||||
*/
|
||||
reporterOptions: { [key: string]: any }
|
||||
/**
|
||||
* Slow test threshold in milliseconds. Only affects the visual output of some reporters. For example, the spec reporter will display the test time in yellow if over the threshold.
|
||||
* @default 10000
|
||||
*/
|
||||
slowTestThreshold: number
|
||||
/**
|
||||
* Whether Cypress will watch and restart tests on test file changes
|
||||
* @default true
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
# [@cypress/vite-dev-server-v2.2.0](https://github.com/cypress-io/cypress/compare/@cypress/vite-dev-server-v2.1.1...@cypress/vite-dev-server-v2.2.0) (2021-10-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* normalized signatures webpack & vite servers ([#18379](https://github.com/cypress-io/cypress/issues/18379)) ([8f5308f](https://github.com/cypress-io/cypress/commit/8f5308f7068b80fb877da539ce34fb67ba497c4f))
|
||||
|
||||
# [@cypress/vite-dev-server-v2.1.1](https://github.com/cypress-io/cypress/compare/@cypress/vite-dev-server-v2.1.0...@cypress/vite-dev-server-v2.1.1) (2021-10-04)
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
# [@cypress/webpack-dev-server-v1.7.0](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.6.0...@cypress/webpack-dev-server-v1.7.0) (2021-10-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* normalized signatures webpack & vite servers ([#18379](https://github.com/cypress-io/cypress/issues/18379)) ([8f5308f](https://github.com/cypress-io/cypress/commit/8f5308f7068b80fb877da539ce34fb67ba497c4f))
|
||||
|
||||
# [@cypress/webpack-dev-server-v1.6.0](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.5.0...@cypress/webpack-dev-server-v1.6.0) (2021-09-10)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cypress",
|
||||
"version": "8.6.0",
|
||||
"version": "8.7.0",
|
||||
"description": "Cypress.io end to end testing tool",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
@@ -247,6 +247,7 @@
|
||||
"**/jquery": "3.1.1",
|
||||
"**/pretty-format": "26.4.0",
|
||||
"**/socket.io-parser": "4.0.4",
|
||||
"**/ua-parser-js": "0.7.24",
|
||||
"vue-template-compiler": "2.6.12"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -500,6 +500,8 @@ const create = (specWindow, Cypress, config) => {
|
||||
|
||||
const _mocha = createMocha(specWindow)
|
||||
|
||||
_mocha.slow(config('slowTestThreshold'))
|
||||
|
||||
const _runner = getRunner(_mocha)
|
||||
|
||||
_mocha.suite.file = Cypress.spec.relative
|
||||
|
||||
@@ -21,7 +21,7 @@ const TEST_BEFORE_RUN_EVENT = 'runner:test:before:run'
|
||||
const TEST_AFTER_RUN_EVENT = 'runner:test:after:run'
|
||||
|
||||
const RUNNABLE_LOGS = 'routes agents commands hooks'.split(' ')
|
||||
const RUNNABLE_PROPS = '_testConfig id order title _titlePath root hookName hookId err state failedFromHookId body speed type duration wallClockStartedAt wallClockDuration timings file originalTitle invocationDetails final currentRetry retries'.split(' ')
|
||||
const RUNNABLE_PROPS = '_testConfig id order title _titlePath root hookName hookId err state failedFromHookId body speed type duration wallClockStartedAt wallClockDuration timings file originalTitle invocationDetails final currentRetry retries _slow'.split(' ')
|
||||
|
||||
const debug = debugFn('cypress:driver:runner')
|
||||
const debugErrors = debugFn('cypress:driver:errors')
|
||||
@@ -581,6 +581,10 @@ const normalize = (runnable, tests, initialTests, onRunnable, onLogsById, getRun
|
||||
wrappedRunnable._testConfig = cfg
|
||||
}
|
||||
|
||||
if (cfg.slowTestThreshold) {
|
||||
runnable.slow(cfg.slowTestThreshold)
|
||||
}
|
||||
|
||||
wrappedRunnable._titlePath = runnable.titlePath()
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -17,7 +17,7 @@ import findSystemNode from './util/find_system_node'
|
||||
const debug = Debug('cypress:server:config')
|
||||
|
||||
import { options, breakingOptions } from './config_options'
|
||||
import { getProcessEnvVars } from './util/config'
|
||||
import { getProcessEnvVars, CYPRESS_SPECIAL_ENV_VARS } from './util/config'
|
||||
|
||||
export const RESOLVED_FROM = ['plugin', 'env', 'default', 'runtime', 'config'] as const
|
||||
|
||||
@@ -32,18 +32,6 @@ export type ResolvedConfigurationOptions = Partial<{
|
||||
[x in keyof Cypress.ResolvedConfigOptions]: ResolvedFromConfig
|
||||
}>
|
||||
|
||||
export const CYPRESS_ENV_PREFIX = 'CYPRESS_'
|
||||
|
||||
export const CYPRESS_ENV_PREFIX_LENGTH = 'CYPRESS_'.length
|
||||
|
||||
export const CYPRESS_RESERVED_ENV_VARS = [
|
||||
'CYPRESS_INTERNAL_ENV',
|
||||
]
|
||||
|
||||
export const CYPRESS_SPECIAL_ENV_VARS = [
|
||||
'RECORD_KEY',
|
||||
]
|
||||
|
||||
const dashesOrUnderscoresRe = /^(_-)+/
|
||||
|
||||
// takes an array and creates an index object of [keyKey]: [valueKey]
|
||||
@@ -269,6 +257,11 @@ export function mergeDefaults (config: Record<string, any> = {}, options: Record
|
||||
|
||||
_.defaults(config, defaultValues)
|
||||
|
||||
// Default values can be functions, in which case they are evaluated
|
||||
// at runtime - for example, slowTestThreshold where the default value
|
||||
// varies between e2e and component testing.
|
||||
config = _.mapValues(config, (value) => (typeof value === 'function' ? value(options) : value))
|
||||
|
||||
// split out our own app wide env from user env variables
|
||||
// and delete envFile
|
||||
config.env = parseEnv(config, options.env, resolved)
|
||||
@@ -291,7 +284,7 @@ export function mergeDefaults (config: Record<string, any> = {}, options: Record
|
||||
config.numTestsKeptInMemory = 0
|
||||
}
|
||||
|
||||
config = setResolvedConfigValues(config, defaultValues, resolved)
|
||||
config = setResolvedConfigValues(config, defaultValues, resolved, options)
|
||||
|
||||
if (config.port) {
|
||||
config = setUrls(config)
|
||||
@@ -316,10 +309,10 @@ export function mergeDefaults (config: Record<string, any> = {}, options: Record
|
||||
.then(_.partialRight(setNodeBinary, options.onWarning))
|
||||
}
|
||||
|
||||
export function setResolvedConfigValues (config, defaults, resolved) {
|
||||
export function setResolvedConfigValues (config, defaults, resolved, options) {
|
||||
const obj = _.clone(config)
|
||||
|
||||
obj.resolved = resolveConfigValues(config, defaults, resolved)
|
||||
obj.resolved = resolveConfigValues(config, defaults, resolved, options)
|
||||
debug('resolved config is %o', obj.resolved.browsers)
|
||||
|
||||
return obj
|
||||
@@ -424,7 +417,7 @@ export function updateWithPluginValues (cfg, overrides) {
|
||||
// combines the default configuration object with values specified in the
|
||||
// configuration file like "cypress.json". Values in configuration file
|
||||
// overwrite the defaults.
|
||||
export function resolveConfigValues (config, defaults, resolved = {}) {
|
||||
export function resolveConfigValues (config, defaults, resolved = {}, options = {}) {
|
||||
// pick out only known configuration keys
|
||||
return _
|
||||
.chain(config)
|
||||
@@ -448,7 +441,9 @@ export function resolveConfigValues (config, defaults, resolved = {}) {
|
||||
return source(r)
|
||||
}
|
||||
|
||||
if (!(!_.isEqual(config[key], defaults[key]) && key !== 'browsers')) {
|
||||
const defaultValue = typeof defaults[key] === 'function' ? defaults[key](options) : defaults[key]
|
||||
|
||||
if (!(!_.isEqual(config[key], defaultValue) && key !== 'browsers')) {
|
||||
// "browsers" list is special, since it is dynamic by default
|
||||
// and can only be ovewritten via plugins file
|
||||
return source('default')
|
||||
|
||||
@@ -216,6 +216,10 @@ export const options = [
|
||||
defaultValue: 'cypress/screenshots',
|
||||
validation: v.isStringOrFalse,
|
||||
isFolder: true,
|
||||
}, {
|
||||
name: 'slowTestThreshold',
|
||||
defaultValue: (options: Record<string, any>) => options.testingType === 'component' ? 250 : 10000,
|
||||
validation: v.isNumber,
|
||||
}, {
|
||||
name: 'socketId',
|
||||
defaultValue: null,
|
||||
|
||||
@@ -8,6 +8,7 @@ const Mocha = require('mocha-7.0.1')
|
||||
const mochaReporters = require('mocha-7.0.1/lib/reporters')
|
||||
const mochaCreateStatsCollector = require('mocha-7.0.1/lib/stats-collector')
|
||||
const mochaColor = mochaReporters.Base.color
|
||||
const mochaSymbols = mochaReporters.Base.symbols
|
||||
|
||||
const debug = require('debug')('cypress:server:reporter')
|
||||
const Promise = require('bluebird')
|
||||
@@ -293,6 +294,34 @@ class Reporter {
|
||||
reporterOptions: this.reporterOptions,
|
||||
})
|
||||
|
||||
if (this.reporterName === 'spec') {
|
||||
// Unfortunately the reporter doesn't expose its indentation logic, so we have to replicate it here
|
||||
let indents = 0
|
||||
|
||||
this.runner.on('suite', function (suite) {
|
||||
++indents
|
||||
})
|
||||
|
||||
this.runner.on('suite end', function () {
|
||||
--indents
|
||||
})
|
||||
|
||||
// Override the default reporter to always show test timing even for fast tests
|
||||
// and display slow ones in yellow rather than red
|
||||
this.runner._events.pass[2] = function (test) {
|
||||
const durationColor = test.speed === 'slow' ? 'medium' : 'fast'
|
||||
const fmt =
|
||||
Array(indents).join(' ') +
|
||||
mochaColor('checkmark', ` ${ mochaSymbols.ok}`) +
|
||||
mochaColor('pass', ' %s') +
|
||||
mochaColor(durationColor, ' (%dms)')
|
||||
|
||||
// Log: `✓ test title (300ms)` when a test passes
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(fmt, test.title, test.duration)
|
||||
}
|
||||
}
|
||||
|
||||
this.runner.ignoreLeaks = true
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
import _ from 'lodash'
|
||||
import {
|
||||
CYPRESS_ENV_PREFIX,
|
||||
CYPRESS_ENV_PREFIX_LENGTH,
|
||||
CYPRESS_RESERVED_ENV_VARS,
|
||||
} from '../config'
|
||||
import { coerce } from './coerce'
|
||||
|
||||
export const CYPRESS_ENV_PREFIX = 'CYPRESS_'
|
||||
|
||||
export const CYPRESS_ENV_PREFIX_LENGTH = 'CYPRESS_'.length
|
||||
|
||||
export const CYPRESS_RESERVED_ENV_VARS = [
|
||||
'CYPRESS_INTERNAL_ENV',
|
||||
]
|
||||
|
||||
export const CYPRESS_SPECIAL_ENV_VARS = [
|
||||
'RECORD_KEY',
|
||||
]
|
||||
|
||||
export const isDefault = (config: Record<string, any>, prop: string) => {
|
||||
return config.resolved[prop].from === 'default'
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ const utils = require(`${root}../lib/browsers/utils`)
|
||||
const snapshot = require('snap-shot-it')
|
||||
|
||||
const normalizeBrowsers = (message) => {
|
||||
return message.replace(/(found are: ).*/, '$1chrome, firefox, electron')
|
||||
return message.replace(/(found on your system are:)(?:\n- .*)*/, '$1\n- chrome\n- firefox\n- electron')
|
||||
}
|
||||
|
||||
// When we added component testing mode, we added the option for electron to be omitted
|
||||
|
||||
@@ -1079,6 +1079,14 @@ describe('lib/config', () => {
|
||||
}
|
||||
})
|
||||
|
||||
it('slowTestThreshold=10000 for e2e', function () {
|
||||
return this.defaults('slowTestThreshold', 10000, {}, { testingType: 'e2e' })
|
||||
})
|
||||
|
||||
it('slowTestThreshold=250 for component', function () {
|
||||
return this.defaults('slowTestThreshold', 250, {}, { testingType: 'component' })
|
||||
})
|
||||
|
||||
it('port=null', function () {
|
||||
return this.defaults('port', null)
|
||||
})
|
||||
@@ -1462,6 +1470,7 @@ describe('lib/config', () => {
|
||||
retries: { value: { runMode: 0, openMode: 0 }, from: 'default' },
|
||||
screenshotOnRunFailure: { value: true, from: 'default' },
|
||||
screenshotsFolder: { value: 'cypress/screenshots', from: 'default' },
|
||||
slowTestThreshold: { value: 10000, from: 'default' },
|
||||
supportFile: { value: 'cypress/support', from: 'default' },
|
||||
taskTimeout: { value: 60000, from: 'default' },
|
||||
testFiles: { value: '**/*.*', from: 'default' },
|
||||
@@ -1568,6 +1577,7 @@ describe('lib/config', () => {
|
||||
retries: { value: { runMode: 0, openMode: 0 }, from: 'default' },
|
||||
screenshotOnRunFailure: { value: true, from: 'default' },
|
||||
screenshotsFolder: { value: 'cypress/screenshots', from: 'default' },
|
||||
slowTestThreshold: { value: 10000, from: 'default' },
|
||||
supportFile: { value: 'cypress/support', from: 'default' },
|
||||
taskTimeout: { value: 60000, from: 'default' },
|
||||
testFiles: { value: '**/*.*', from: 'default' },
|
||||
@@ -2412,25 +2422,3 @@ describe('lib/config', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('lib/util/config', () => {
|
||||
context('.isDefault', () => {
|
||||
it('returns true if value is default value', () => {
|
||||
settings = { baseUrl: null }
|
||||
const defaults = { baseUrl: null }
|
||||
const resolved = {}
|
||||
const merged = config.setResolvedConfigValues(settings, defaults, resolved)
|
||||
|
||||
expect(configUtil.isDefault(merged, 'baseUrl')).to.be.true
|
||||
})
|
||||
|
||||
it('returns false if value is not default value', () => {
|
||||
settings = { baseUrl: null }
|
||||
const defaults = { baseUrl: 'http://localhost:8080' }
|
||||
const resolved = {}
|
||||
const merged = config.setResolvedConfigValues(settings, defaults, resolved)
|
||||
|
||||
expect(configUtil.isDefault(merged, 'baseUrl')).to.be.false
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -111,7 +111,6 @@ describe('lib/reporter', () => {
|
||||
it('recursively creates suites for fullTitle', function () {
|
||||
const args = this.reporter.parseArgs('fail', [this.testObj])
|
||||
|
||||
console.log(args)
|
||||
expect(args[0]).to.eq('fail')
|
||||
|
||||
const title = 'TodoMVC - React When page is initially opened should focus on the todo input field'
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
require('../spec_helper')
|
||||
require('../../spec_helper')
|
||||
|
||||
const path = require('path')
|
||||
const os = require('os')
|
||||
const snapshot = require('snap-shot-it')
|
||||
const stripAnsi = require('strip-ansi')
|
||||
const minimist = require('minimist')
|
||||
const argsUtil = require(`${root}lib/util/args`)
|
||||
const getWindowsProxyUtil = require(`${root}lib/util/get-windows-proxy`)
|
||||
const argsUtil = require(`${root}../lib/util/args`)
|
||||
const getWindowsProxyUtil = require(`${root}../lib/util/get-windows-proxy`)
|
||||
|
||||
const cwd = process.cwd()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
require('../spec_helper')
|
||||
require('../../spec_helper')
|
||||
|
||||
const CacheBuster = require(`${root}lib/util/cache_buster`)
|
||||
const CacheBuster = require(`${root}../lib/util/cache_buster`)
|
||||
|
||||
describe('lib/cache_buster', () => {
|
||||
context('#get', () => {
|
||||
@@ -1,8 +1,8 @@
|
||||
require('../spec_helper')
|
||||
require('../../spec_helper')
|
||||
|
||||
const _ = require('lodash')
|
||||
const { stripIndent } = require('common-tags')
|
||||
const chromePolicyCheck = require(`${root}lib/util/chrome_policy_check`)
|
||||
const chromePolicyCheck = require(`${root}../lib/util/chrome_policy_check`)
|
||||
|
||||
describe('lib/util/chrome_policy_check', () => {
|
||||
context('.getRunner returns a function', () => {
|
||||
@@ -1,8 +1,8 @@
|
||||
const mockedEnv = require('mocked-env')
|
||||
|
||||
require('../spec_helper')
|
||||
require('../../spec_helper')
|
||||
|
||||
const ciProvider = require(`${root}lib/util/ci_provider`)
|
||||
const ciProvider = require(`${root}../lib/util/ci_provider`)
|
||||
|
||||
const expectsName = (name) => {
|
||||
expect(ciProvider.provider(), 'CI providers detected name').to.eq(name)
|
||||
@@ -1,7 +1,7 @@
|
||||
require('../spec_helper')
|
||||
require('../../spec_helper')
|
||||
|
||||
const { coerce } = require(`${root}lib/util/coerce`)
|
||||
const { getProcessEnvVars } = require(`${root}lib/util/config`)
|
||||
const { coerce } = require(`${root}../lib/util/coerce`)
|
||||
const { getProcessEnvVars } = require(`${root}../lib/util/config`)
|
||||
|
||||
describe('lib/util/coerce', () => {
|
||||
beforeEach(function () {
|
||||
48
packages/server/test/unit/util/config_spec.js
Normal file
48
packages/server/test/unit/util/config_spec.js
Normal file
@@ -0,0 +1,48 @@
|
||||
require('../../spec_helper')
|
||||
|
||||
const configUtil = require(`${root}../lib/util/config`)
|
||||
|
||||
describe('lib/util/config', () => {
|
||||
context('.isDefault', () => {
|
||||
it('returns true if value is default value', () => {
|
||||
const options = {
|
||||
resolved: {
|
||||
baseUrl: { from: 'default' },
|
||||
},
|
||||
}
|
||||
|
||||
expect(configUtil.isDefault(options, 'baseUrl')).to.be.true
|
||||
})
|
||||
|
||||
it('returns false if value is not default value', () => {
|
||||
const options = {
|
||||
resolved: {
|
||||
baseUrl: { from: 'cli' },
|
||||
},
|
||||
}
|
||||
|
||||
expect(configUtil.isDefault(options, 'baseUrl')).to.be.false
|
||||
})
|
||||
})
|
||||
|
||||
context('.getProcessEnvVars', () => {
|
||||
it('returns process envs prefixed with cypress', () => {
|
||||
const envs = {
|
||||
CYPRESS_BASE_URL: 'value',
|
||||
RANDOM_ENV: 'ignored',
|
||||
}
|
||||
|
||||
expect(configUtil.getProcessEnvVars(envs)).to.deep.eq({
|
||||
BASE_URL: 'value',
|
||||
})
|
||||
})
|
||||
|
||||
it('does not return CYPRESS_RESERVED_ENV_VARS', () => {
|
||||
const envs = {
|
||||
CYPRESS_INTERNAL_ENV: 'value',
|
||||
}
|
||||
|
||||
expect(configUtil.getProcessEnvVars(envs)).to.deep.eq({})
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -1,6 +1,6 @@
|
||||
require('../spec_helper')
|
||||
require('../../spec_helper')
|
||||
|
||||
const duration = require(`${root}lib/util/duration`)
|
||||
const duration = require(`${root}../lib/util/duration`)
|
||||
|
||||
describe('lib/util/duration', () => {
|
||||
context('.format', () => {
|
||||
@@ -1,7 +1,7 @@
|
||||
import '../spec_helper'
|
||||
import '../../spec_helper'
|
||||
|
||||
import { connect, agent } from '@packages/network'
|
||||
import { isListening } from '../../lib/util/ensure-url'
|
||||
import { isListening } from '../../../lib/util/ensure-url'
|
||||
import sinon from 'sinon'
|
||||
import nock from 'nock'
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
require('../spec_helper')
|
||||
require('../../spec_helper')
|
||||
|
||||
const os = require('os')
|
||||
const path = require('path')
|
||||
const Promise = require('bluebird')
|
||||
const lockFile = Promise.promisifyAll(require('lockfile'))
|
||||
const { fs } = require(`${root}lib/util/fs`)
|
||||
const env = require(`${root}lib/util/env`)
|
||||
const exit = require(`${root}lib/util/exit`)
|
||||
const FileUtil = require(`${root}lib/util/file`)
|
||||
const { fs } = require(`${root}../lib/util/fs`)
|
||||
const env = require(`${root}../lib/util/env`)
|
||||
const exit = require(`${root}../lib/util/exit`)
|
||||
const FileUtil = require(`${root}../lib/util/file`)
|
||||
|
||||
describe('lib/util/file', () => {
|
||||
beforeEach(function () {
|
||||
@@ -1,7 +1,7 @@
|
||||
require('../spec_helper')
|
||||
require('../../spec_helper')
|
||||
|
||||
const humanInterval = require('human-interval')
|
||||
const humanTime = require(`${root}lib/util/human_time`)
|
||||
const humanTime = require(`${root}../lib/util/human_time`)
|
||||
|
||||
describe('lib/util/human_time', () => {
|
||||
context('.long', () => {
|
||||
@@ -1,6 +1,6 @@
|
||||
import '../spec_helper'
|
||||
import '../../spec_helper'
|
||||
|
||||
import newlines from '../../lib/util/newlines'
|
||||
import newlines from '../../../lib/util/newlines'
|
||||
|
||||
describe('lib/util/newlines', function () {
|
||||
it('inserts newline at each n char', function () {
|
||||
@@ -1,7 +1,7 @@
|
||||
require('../spec_helper')
|
||||
require('../../spec_helper')
|
||||
|
||||
const cp = require('child_process')
|
||||
const open = require(`${root}lib/util/open`)
|
||||
const open = require(`${root}../lib/util/open`)
|
||||
|
||||
const platform = (p) => {
|
||||
return Object.defineProperty(process, 'platform', {
|
||||
@@ -1,6 +1,6 @@
|
||||
require('../spec_helper')
|
||||
require('../../spec_helper')
|
||||
|
||||
const origin = require(`${root}lib/util/origin`)
|
||||
const origin = require(`${root}../lib/util/origin`)
|
||||
|
||||
describe('lib/util/origin', () => {
|
||||
beforeEach(function () {
|
||||
@@ -1,6 +1,6 @@
|
||||
require('../spec_helper')
|
||||
require('../../spec_helper')
|
||||
|
||||
const path_helpers = require(`${root}lib/util/path_helpers`)
|
||||
const path_helpers = require(`${root}../lib/util/path_helpers`)
|
||||
|
||||
describe('lib/util/path_helpers', () => {
|
||||
context('checkIfResolveChangedRootFolder', () => {
|
||||
@@ -1,10 +1,10 @@
|
||||
require('../spec_helper')
|
||||
require('../../spec_helper')
|
||||
|
||||
const os = require('os')
|
||||
const path = require('path')
|
||||
const { fs } = require(`${root}/lib/util/fs`)
|
||||
const findProcess = require(`${root}lib/util/find_process`)
|
||||
const profileCleaner = require(`${root}lib/util/profile_cleaner`)
|
||||
const { fs } = require(`${root}../lib/util/fs`)
|
||||
const findProcess = require(`${root}../lib/util/find_process`)
|
||||
const profileCleaner = require(`${root}../lib/util/profile_cleaner`)
|
||||
|
||||
const tmpDir = os.tmpdir()
|
||||
const pidProfilesFolder = path.join(tmpDir, 'pid-profiles')
|
||||
@@ -1,7 +1,7 @@
|
||||
require('../spec_helper')
|
||||
require('../../spec_helper')
|
||||
|
||||
const randomstring = require('randomstring')
|
||||
const random = require(`${root}lib/util/random`)
|
||||
const random = require(`${root}../lib/util/random`)
|
||||
|
||||
context('.id', () => {
|
||||
it('returns random.generate string with length 5 by default', () => {
|
||||
@@ -1,6 +1,6 @@
|
||||
require('../spec_helper')
|
||||
require('../../spec_helper')
|
||||
|
||||
const { apiRoutes, onRoutes } = require(`${root}/lib/util/routes`)
|
||||
const { apiRoutes, onRoutes } = require(`${root}../lib/util/routes`)
|
||||
|
||||
describe('lib/util/routes', () => {
|
||||
describe('api routes', () => {
|
||||
@@ -1,9 +1,9 @@
|
||||
require('../spec_helper')
|
||||
require('../../spec_helper')
|
||||
|
||||
const R = require('ramda')
|
||||
const path = require('path')
|
||||
const config = require(`${root}lib/config`)
|
||||
const specsUtil = require(`${root}lib/util/specs`).default
|
||||
const config = require(`${root}../lib/config`)
|
||||
const specsUtil = require(`${root}../lib/util/specs`).default
|
||||
const FixturesHelper = require('@tooling/system-tests/lib/fixtures')
|
||||
const debug = require('debug')('test')
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
require('../spec_helper')
|
||||
require('../../spec_helper')
|
||||
|
||||
const _ = require('lodash')
|
||||
const fs = require('fs')
|
||||
const stream = require('stream')
|
||||
const Promise = require('bluebird')
|
||||
const { concatStream } = require('@packages/network')
|
||||
const { streamBuffer } = require('../../lib/util/stream_buffer')
|
||||
const { streamBuffer } = require('../../../lib/util/stream_buffer')
|
||||
|
||||
function drain (stream) {
|
||||
return new Promise((resolve) => {
|
||||
@@ -1,4 +1,4 @@
|
||||
import '../spec_helper'
|
||||
import '../../spec_helper'
|
||||
import { expect } from 'chai'
|
||||
import execa from 'execa'
|
||||
import proxyquire from 'proxyquire'
|
||||
@@ -6,7 +6,7 @@ import proxyquire from 'proxyquire'
|
||||
const ERROR_MESSAGE = 'Setting the NODE_TLS_REJECT_UNAUTHORIZED'
|
||||
|
||||
const TLS_CONNECT = `require('tls').connect().on('error', ()=>{});`
|
||||
const SUPPRESS_WARNING = `require('${__dirname}/../../lib/util/suppress_warnings').suppress();`
|
||||
const SUPPRESS_WARNING = `require('${__dirname}/../../../lib/util/suppress_warnings').suppress();`
|
||||
|
||||
describe('lib/util/suppress_warnings', function () {
|
||||
it('tls.connect emits warning if NODE_TLS_REJECT_UNAUTHORIZED=0 and not suppressed', function () {
|
||||
@@ -36,7 +36,7 @@ describe('lib/util/suppress_warnings', function () {
|
||||
const emitWarning = sinon.spy(process, 'emitWarning')
|
||||
|
||||
// force typescript to always be non-requireable
|
||||
const { suppress } = proxyquire('../../lib/util/suppress_warnings', {})
|
||||
const { suppress } = proxyquire('../../../lib/util/suppress_warnings', {})
|
||||
|
||||
suppress()
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
require('../spec_helper')
|
||||
require('../../spec_helper')
|
||||
|
||||
const snapshot = require('snap-shot-it')
|
||||
const stripAnsi = require('strip-ansi')
|
||||
const widestLine = require('widest-line')
|
||||
const env = require(`${root}lib/util/env`)
|
||||
const terminal = require(`${root}lib/util/terminal`)
|
||||
const terminalSize = require(`${root}lib/util/terminal-size`)
|
||||
const env = require(`${root}../lib/util/env`)
|
||||
const terminal = require(`${root}../lib/util/terminal`)
|
||||
const terminalSize = require(`${root}../lib/util/terminal-size`)
|
||||
|
||||
const sanitizeSnapshot = (str) => {
|
||||
return snapshot(stripAnsi(str))
|
||||
@@ -1,9 +1,9 @@
|
||||
require('../spec_helper')
|
||||
require('../../spec_helper')
|
||||
|
||||
const fs = require('fs')
|
||||
const os = require('os')
|
||||
const path = require('path')
|
||||
const trash = require(`${root}lib/util/trash`)
|
||||
const trash = require(`${root}../lib/util/trash`)
|
||||
|
||||
const populateDirectories = function (basePath) {
|
||||
fs.mkdirSync(basePath)
|
||||
@@ -1,8 +1,8 @@
|
||||
require('../spec_helper')
|
||||
require('../../spec_helper')
|
||||
|
||||
const tty = require('tty')
|
||||
const ttyUtil = require(`${root}lib/util/tty`)
|
||||
const terminalSize = require(`${root}lib/util/terminal-size`)
|
||||
const ttyUtil = require(`${root}../lib/util/tty`)
|
||||
const terminalSize = require(`${root}../lib/util/terminal-size`)
|
||||
|
||||
const ttys = [process.stdin.isTTY, process.stdout.isTTY, process.stderr.isTTY]
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
/* eslint-disable no-undef */
|
||||
describe('slowTestThreshold', () => {
|
||||
it('passes inherited', () => {
|
||||
cy.wait(5)
|
||||
cy.wrap(true).should('be.true')
|
||||
})
|
||||
|
||||
it('passes quickly', { slowTestThreshold: 10000 }, () => {
|
||||
cy.wrap(true).should('be.true')
|
||||
})
|
||||
|
||||
it('passes slowly', { slowTestThreshold: 1 }, () => {
|
||||
cy.wait(5)
|
||||
cy.wrap(true).should('be.true')
|
||||
})
|
||||
})
|
||||
@@ -145,4 +145,21 @@ describe('e2e reporters', () => {
|
||||
reporterOptions: 'topLevelSuite=top suite,flowId=12345,useStdError=\'true\',useStdError=\'true\',recordHookFailures=\'true\',actualVsExpected=\'true\'',
|
||||
})
|
||||
})
|
||||
|
||||
it('shows slow tests in yellow', function () {
|
||||
return systemTests.exec(this, {
|
||||
spec: 'slowTestThreshold_spec.js',
|
||||
snapshot: false,
|
||||
config: {
|
||||
slowTestThreshold: 1,
|
||||
},
|
||||
processEnv: {
|
||||
MOCHA_COLORS: 1,
|
||||
},
|
||||
}).then((result) => {
|
||||
expect(result.stdout.match(/passes inherited(.*)/)[1]).to.contain('\u001b[33m')
|
||||
expect(result.stdout.match(/passes quickly(.*)/)[1]).not.to.contain('\u001b[33m')
|
||||
expect(result.stdout.match(/passes slowly(.*)/)[1]).to.contain('\u001b[33m')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -38354,7 +38354,7 @@ typescript@^3.9.7:
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.9.tgz#e69905c54bc0681d0518bd4d587cc6f2d0b1a674"
|
||||
integrity sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==
|
||||
|
||||
ua-parser-js@^0.7.18:
|
||||
ua-parser-js@0.7.24, ua-parser-js@^0.7.18:
|
||||
version "0.7.24"
|
||||
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.24.tgz#8d3ecea46ed4f1f1d63ec25f17d8568105dc027c"
|
||||
integrity sha512-yo+miGzQx5gakzVK3QFfN0/L9uVhosXBBO7qmnk7c2iw1IhL212wfA3zbnI54B0obGwC/5NWub/iT9sReMx+Fw==
|
||||
|
||||
Reference in New Issue
Block a user