Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('api is readonly within node', function () {
// Only run if our environment supports this
if ( typeof window === 'undefined' ) {
// Attempt modification
try {
joe.blah = "was set when it shouldn't have been"
}
catch (err) {
// https://travis-ci.org/bevry/joe/jobs/135251737
}
// Test that the modifications were not successful
equal(joe.blah == null, true, `modification test, result: ${joe.blah}`)
}
})
test('api is readonly within node', function() {
// Only run if our environment supports this
if (typeof window === 'undefined') {
// Attempt modification
try {
kava.blah = "was set when it shouldn't have been"
} catch (err) {
// https://travis-ci.org/bevry/kava/jobs/135251737
}
// Test that the modifications were not successful
assert.equal(
kava.blah == null,
true,
'modification test, result: ' + kava.blah
)
}
})
})
runner.once('close', function() {
output = output.replace(/[\n\s]+at .+/g, '').replace(/^\s|\s$/g, '')
try {
equal(output.trim(), expectedCleaned.trim())
} catch (err) {
return complete(err)
}
process.stdout.write('\n^^ the above was as expected ^^\n')
return complete()
})
})
test('test 4', function() {
checks.push('test 4')
assert.deepEqual(
checks,
[
'before - test 1 - part 1',
'before - test 1 - part 2',
'test 1',
'after - test 1 - part 1',
'after - test 1 - part 2',
'before - test 2 - part 1',
'before - test 2 - part 2',
'test 2',
'after - test 2 - part 1',
'after - test 2 - part 2',
'only before - test 3 - part 1',
'only before - test 3 - part 2',
'before - test 3 - part 1',
'before - test 3 - part 2',
test('test 4', function () {
checks.push('test 4')
deepEqual(checks, [
'before - test 1 - part 1',
'before - test 1 - part 2',
'test 1',
'after - test 1 - part 1',
'after - test 1 - part 2',
'before - test 2 - part 1',
'before - test 2 - part 2',
'test 2',
'after - test 2 - part 1',
'after - test 2 - part 2',
'only before - test 3 - part 1',
'only before - test 3 - part 2',
'before - test 3 - part 1',
'before - test 3 - part 2',
'test 3',
'only after - test 3 - part 1',
test('2/2', function () {
checks.push(2)
deepEqual(checks, [1, 2])
})
})
test('test 3', { before, after }, function() {
checks.push('test 3')
assert.deepEqual(
checks,
[
'before - test 1 - part 1',
'before - test 1 - part 2',
'test 1',
'after - test 1 - part 1',
'after - test 1 - part 2',
'before - test 2 - part 1',
'before - test 2 - part 2',
'test 2',
'after - test 2 - part 1',
'after - test 2 - part 2',
'only before - test 3 - part 1',
'only before - test 3 - part 2',
'before - test 3 - part 1',
'before - test 3 - part 2',
test('test 3', {before, after}, function () {
checks.push('test 3')
deepEqual(checks, [
'before - test 1 - part 1',
'before - test 1 - part 2',
'test 1',
'after - test 1 - part 1',
'after - test 1 - part 2',
'before - test 2 - part 1',
'before - test 2 - part 2',
'test 2',
'after - test 2 - part 1',
'after - test 2 - part 2',
'only before - test 3 - part 1',
'only before - test 3 - part 2',
'before - test 3 - part 1',
'before - test 3 - part 2',
'test 3'
], 'test 3 checks')
test('test 2', function() {
checks.push('test 2')
assert.deepEqual(checks, [
'before - test 1 - part 1',
'before - test 1 - part 2',
'test 1',
'after - test 1 - part 1',
'after - test 1 - part 2',
'before - test 2 - part 1',
'before - test 2 - part 2',
'test 2'
])
})
this.done(function(err, result) {
assert.errorEqual(err, null)
assert.deepEqual(result, [[err1], [err2]])
})
})