|
|
@ -33,7 +33,7 @@ test('Without Pool: test file with exclusive tests causes non-exclusive tests in |
|
|
|
|
|
|
|
var api = new Api(); |
|
|
|
|
|
|
|
api.run(files) |
|
|
|
return api.run(files) |
|
|
|
.then(function (result) { |
|
|
|
t.ok(result.hasExclusive); |
|
|
|
t.is(result.testCount, 2); |
|
|
@ -69,7 +69,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
|
|
|
|
var api = apiCreator(); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/es2015.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/es2015.js')]) |
|
|
|
.then(function (result) { |
|
|
|
t.is(result.passCount, 1); |
|
|
|
}); |
|
|
@ -80,7 +80,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
|
|
|
|
var api = apiCreator(); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/generators.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/generators.js')]) |
|
|
|
.then(function (result) { |
|
|
|
t.is(result.passCount, 1); |
|
|
|
}); |
|
|
@ -91,7 +91,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
|
|
|
|
var api = apiCreator(); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/async-await.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/async-await.js')]) |
|
|
|
.then(function (result) { |
|
|
|
t.is(result.passCount, 2); |
|
|
|
}); |
|
|
@ -215,7 +215,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
|
|
|
|
var api = apiCreator(); |
|
|
|
|
|
|
|
api.run(files) |
|
|
|
return api.run(files) |
|
|
|
.then(function (result) { |
|
|
|
t.is(result.passCount, 2); |
|
|
|
t.is(result.failCount, 1); |
|
|
@ -235,7 +235,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
|
|
|
|
var api = apiCreator(); |
|
|
|
|
|
|
|
api.run(files) |
|
|
|
return api.run(files) |
|
|
|
.then(function (result) { |
|
|
|
t.is(result.passCount, 1); |
|
|
|
t.is(result.failCount, 1); |
|
|
@ -261,7 +261,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/fail-fast.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/fail-fast.js')]) |
|
|
|
.then(function (result) { |
|
|
|
t.ok(api.options.failFast); |
|
|
|
t.strictDeepEqual(tests, [{ |
|
|
@ -284,7 +284,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
serial: true |
|
|
|
}); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/serial.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/serial.js')]) |
|
|
|
.then(function (result) { |
|
|
|
t.ok(api.options.serial); |
|
|
|
t.is(result.passCount, 3); |
|
|
@ -297,7 +297,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
|
|
|
|
var api = apiCreator(); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/circular-reference-on-assertion.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/circular-reference-on-assertion.js')]) |
|
|
|
.then(function (result) { |
|
|
|
t.is(result.failCount, 1); |
|
|
|
t.match(result.errors[0].error.message, /'c'.*?'d'/); |
|
|
@ -309,7 +309,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
|
|
|
|
var api = apiCreator(); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/process-cwd.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/process-cwd.js')]) |
|
|
|
.then(function (result) { |
|
|
|
t.is(result.passCount, 1); |
|
|
|
}); |
|
|
@ -327,7 +327,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/loud-rejection.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/loud-rejection.js')]) |
|
|
|
.then(function (result) { |
|
|
|
t.is(result.passCount, 1); |
|
|
|
}); |
|
|
@ -345,7 +345,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/uncaught-exception.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/uncaught-exception.js')]) |
|
|
|
.then(function (result) { |
|
|
|
t.is(result.passCount, 1); |
|
|
|
}); |
|
|
@ -356,7 +356,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
|
|
|
|
var api = apiCreator(); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/error-without-message.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/error-without-message.js')]) |
|
|
|
.then(function (result) { |
|
|
|
t.is(result.failCount, 1); |
|
|
|
t.is(result.errors.length, 1); |
|
|
@ -378,7 +378,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/source-map-file.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/source-map-file.js')]) |
|
|
|
.then(function (result) { |
|
|
|
t.is(result.passCount, 1); |
|
|
|
}); |
|
|
@ -399,7 +399,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/source-map-file-browser-env.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/source-map-file-browser-env.js')]) |
|
|
|
.then(function (result) { |
|
|
|
t.is(result.passCount, 1); |
|
|
|
}); |
|
|
@ -420,7 +420,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/source-map-file.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/source-map-file.js')]) |
|
|
|
.then(function (result) { |
|
|
|
t.is(result.passCount, 1); |
|
|
|
}); |
|
|
@ -441,7 +441,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/source-map-initial.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/source-map-initial.js')]) |
|
|
|
.then(function (result) { |
|
|
|
t.is(result.passCount, 1); |
|
|
|
}); |
|
|
@ -462,7 +462,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/source-map-initial.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/source-map-initial.js')]) |
|
|
|
.then(function (result) { |
|
|
|
t.is(result.passCount, 1); |
|
|
|
}); |
|
|
@ -473,7 +473,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
|
|
|
|
var api = apiCreator(); |
|
|
|
|
|
|
|
api.run([path.resolve('test/fixture/es2015.js')]) |
|
|
|
return api.run([path.resolve('test/fixture/es2015.js')]) |
|
|
|
.then(function (result) { |
|
|
|
t.is(result.passCount, 1); |
|
|
|
}); |
|
|
@ -484,7 +484,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
|
|
|
|
var api = apiCreator(); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/subdir')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/subdir')]) |
|
|
|
.then(function (result) { |
|
|
|
t.is(result.passCount, 2); |
|
|
|
t.is(result.failCount, 1); |
|
|
@ -496,7 +496,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
|
|
|
|
var api = apiCreator(); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/one-pass-one-fail.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/one-pass-one-fail.js')]) |
|
|
|
.then(function (result) { |
|
|
|
t.match(result.errors[0].title, /this is a failing test/); |
|
|
|
t.match(result.tests[0].title, /this is a passing test/); |
|
|
@ -634,7 +634,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
require: [requirePath] |
|
|
|
}); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/validate-installed-global.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/validate-installed-global.js')]) |
|
|
|
.then(function (result) { |
|
|
|
t.is(result.passCount, 1); |
|
|
|
}); |
|
|
@ -658,7 +658,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/power-assert.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/power-assert.js')]) |
|
|
|
.then(function (result) { |
|
|
|
t.match( |
|
|
|
result.errors[0].error.message, |
|
|
@ -687,7 +687,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
rimraf.sync(path.join(__dirname, 'fixture/caching/node_modules')); |
|
|
|
var api = apiCreator(); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/caching/test.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/caching/test.js')]) |
|
|
|
.then(function () { |
|
|
|
var files = fs.readdirSync(path.join(__dirname, 'fixture/caching/node_modules/.cache/ava')); |
|
|
|
t.is(files.length, 2); |
|
|
@ -710,7 +710,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
rimraf.sync(path.join(__dirname, 'fixture/caching/node_modules')); |
|
|
|
var api = apiCreator({cacheEnabled: false}); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/caching/test.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/caching/test.js')]) |
|
|
|
.then(function () { |
|
|
|
t.false(fs.existsSync(path.join(__dirname, 'fixture/caching/node_modules/.cache/ava'))); |
|
|
|
t.end(); |
|
|
@ -722,7 +722,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
|
|
|
|
var api = apiCreator(); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/skip-only.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/skip-only.js')]) |
|
|
|
.then(function (result) { |
|
|
|
t.is(result.tests.length, 1); |
|
|
|
t.true(result.tests[0].skip); |
|
|
@ -734,7 +734,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
|
|
|
|
var api = apiCreator(); |
|
|
|
|
|
|
|
api.run([path.resolve('test/fixture/es2015.js')]).then(function (result) { |
|
|
|
return api.run([path.resolve('test/fixture/es2015.js')]).then(function (result) { |
|
|
|
t.is(result.passCount, 1); |
|
|
|
return api.run([path.resolve('test/fixture/es2015.js')]); |
|
|
|
}).then(function (result) { |
|
|
@ -840,7 +840,7 @@ function generateTests(prefix, apiCreator) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
api.run([path.join(__dirname, 'fixture/babelrc/test.js')]) |
|
|
|
return api.run([path.join(__dirname, 'fixture/babelrc/test.js')]) |
|
|
|
.then( |
|
|
|
function (result) { |
|
|
|
t.is(result.passCount, 1); |
|
|
|