mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-21 14:40:05 -05:00
f6e87c97ad
* fix: allow http: download url, close #1001 * linting * relinting JS files
21 lines
635 B
JavaScript
21 lines
635 B
JavaScript
const execa = require('execa-wrap')
|
|
const snapshot = require('snap-shot-it')
|
|
|
|
function normalize (s) {
|
|
// assuming the test command tests this spec file
|
|
// and the command is hardcoded in package.json
|
|
// using forward slashes
|
|
return s.replace(process.cwd(), '<folder path>')
|
|
.replace(/passing \(\d+ms\)/, 'passing (<time>ms)')
|
|
.replace(/cypress@(\d+\.\d+\.\d+)/, 'cypress@x.y.z')
|
|
.replace(/✓/g, 'Y') // Mocha check on Mac
|
|
.replace(/√/g, 'Y') // Mocha check on Windows
|
|
}
|
|
|
|
/* eslint-env mocha */
|
|
it('captures mocha output', () => {
|
|
return execa('npm', ['run', 'test-mocha'])
|
|
.then(normalize)
|
|
.then(snapshot)
|
|
})
|