-
Notifications
You must be signed in to change notification settings - Fork 781
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build: Enable ESLint on
/test/integration/
fixtures
Follows-up 0f6ec7c.
- Loading branch information
Showing
11 changed files
with
103 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,47 @@ | ||
const cp = require( "child_process" ); | ||
const path = require( "path" ); | ||
const DIR = path.join( __dirname, "grunt-contrib-qunit" ); | ||
const cp = require('child_process'); | ||
const path = require('path'); | ||
const DIR = path.join(__dirname, 'grunt-contrib-qunit'); | ||
|
||
QUnit.module( "grunt-contrib-qunit", { | ||
before: () => { | ||
QUnit.module('grunt-contrib-qunit', { | ||
before: () => { | ||
// Let this be quick for re-runs | ||
cp.execSync('npm install --prefer-offline --no-audit', { cwd: DIR, encoding: 'utf8' }); | ||
} | ||
}); | ||
|
||
// Let this be quick for re-runs | ||
cp.execSync( "npm install --prefer-offline --no-audit", { cwd: DIR, encoding: "utf8" } ); | ||
} | ||
} ); | ||
QUnit.test('passing tests', assert => { | ||
assert.expect(0); | ||
cp.execSync('npm test', { cwd: DIR }); | ||
}); | ||
|
||
QUnit.test( "passing tests", assert => { | ||
assert.expect( 0 ); | ||
cp.execSync( "npm test", { cwd: DIR } ); | ||
} ); | ||
|
||
QUnit.test.each( "failing tests", { | ||
"assert": [ "fail-assert", `Testing fail-assert.html F | ||
QUnit.test.each('failing tests', { | ||
assert: ['fail-assert', `Testing fail-assert.html F | ||
>> example | ||
>> Message: some message | ||
>> Actual: false | ||
>> Expected: true | ||
>> at ` ], | ||
"no-tests": [ "fail-no-tests", `Testing fail-no-tests.html F | ||
>> at `], | ||
'no-tests': ['fail-no-tests', `Testing fail-no-tests.html F | ||
>> global failure | ||
>> Message: No tests were run. | ||
>> Error: No tests were run. | ||
>> at done (file:)` ] | ||
}, ( assert, [ command, expected ] ) => { | ||
|
||
try { | ||
const ret = cp.execSync( "node_modules/.bin/grunt qunit:" + command, { | ||
cwd: DIR, | ||
env: { | ||
CHROMIUM_FLAGS: process.env.CHROMIUM_FLAGS, | ||
CI: process.env.CI, | ||
PATH: process.env.PATH, | ||
PUPPETEER_DOWNLOAD_PATH: process.env.PUPPETEER_DOWNLOAD_PATH | ||
}, | ||
encoding: "utf8" | ||
} ); | ||
assert.equal( ret, null ); | ||
} catch ( e ) { | ||
const actual = e.stdout.replace( / \(file:.*$/gm, " (file:)" ); | ||
assert.pushResult( { result: actual.includes( expected ), actual, expected } ); | ||
assert.true( e.status > 0, "non-zero exit code" ); | ||
} | ||
} ); | ||
>> at done (file:)`] | ||
}, (assert, [command, expected]) => { | ||
try { | ||
const ret = cp.execSync('node_modules/.bin/grunt qunit:' + command, { | ||
cwd: DIR, | ||
env: { | ||
CHROMIUM_FLAGS: process.env.CHROMIUM_FLAGS, | ||
CI: process.env.CI, | ||
PATH: process.env.PATH, | ||
PUPPETEER_DOWNLOAD_PATH: process.env.PUPPETEER_DOWNLOAD_PATH | ||
}, | ||
encoding: 'utf8' | ||
}); | ||
assert.equal(ret, null); | ||
} catch (e) { | ||
const actual = e.stdout.replace(/ \(file:.*$/gm, ' (file:)'); | ||
assert.pushResult({ result: actual.includes(expected), actual, expected }); | ||
assert.true(e.status > 0, 'non-zero exit code'); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
/* eslint-env node */ | ||
module.exports = function( grunt ) { | ||
grunt.loadNpmTasks( "grunt-contrib-qunit" ); | ||
module.exports = function (grunt) { | ||
grunt.loadNpmTasks('grunt-contrib-qunit'); | ||
|
||
grunt.initConfig( { | ||
qunit: { | ||
options: { | ||
puppeteer: { | ||
args: ( process.env.CHROMIUM_FLAGS || ( process.env.CI ? "--no-sandbox" : "" ) ) | ||
.split( " " ) | ||
} | ||
}, | ||
pass: [ "pass-*.html" ], | ||
"fail-assert": "fail-assert.html", | ||
"fail-no-tests": "fail-no-tests.html" | ||
} | ||
} ); | ||
grunt.initConfig({ | ||
qunit: { | ||
options: { | ||
puppeteer: { | ||
args: (process.env.CHROMIUM_FLAGS || (process.env.CI ? '--no-sandbox' : '')) | ||
.split(' ') | ||
} | ||
}, | ||
pass: ['pass-*.html'], | ||
'fail-assert': 'fail-assert.html', | ||
'fail-no-tests': 'fail-no-tests.html' | ||
} | ||
}); | ||
|
||
grunt.registerTask( "default", [ "qunit:pass" ] ); | ||
grunt.registerTask('default', ['qunit:pass']); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
const add = require( "./src/add.js" ); | ||
const subtract = require( "./src/subtract.js" ); | ||
const add = require('./src/add.js'); | ||
const subtract = require('./src/subtract.js'); | ||
|
||
module.exports = { | ||
add, | ||
subtract | ||
add, | ||
subtract | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
function add( a, b ) { | ||
return a + b; | ||
function add (a, b) { | ||
return a + b; | ||
} | ||
|
||
module.exports = add; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
function substract( a, b ) { | ||
return a - b; | ||
function substract (a, b) { | ||
return a - b; | ||
} | ||
|
||
module.exports = substract; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
const add = require( "../index.js" ).add; | ||
const add = require('../index.js').add; | ||
|
||
QUnit.module( "add", () => { | ||
QUnit.test( "two numbers", assert => { | ||
assert.equal( add( 1, 2 ), 3 ); | ||
} ); | ||
} ); | ||
QUnit.module('add', () => { | ||
QUnit.test('two numbers', assert => { | ||
assert.equal(add(1, 2), 3); | ||
}); | ||
}); |