-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add unit test for lib and an integration test
- Loading branch information
1 parent
1eb95ee
commit 8b45e4f
Showing
12 changed files
with
85 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,4 @@ before_script: | |
script: | ||
- yarn lint | ||
- yarn test | ||
- npm run test:lib |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"env": { | ||
"qunit": true | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module.exports = function (config) { | ||
config.set({ | ||
frameworks: ['qunit'], | ||
|
||
files: [ | ||
'*' | ||
], | ||
|
||
reporters: ['progress'], | ||
|
||
port: 9876, | ||
|
||
colors: true, | ||
|
||
logLevel: config.LOG_INFO, | ||
|
||
autoWatch: false, | ||
|
||
browsers: ['Chrome'], | ||
|
||
singleRun: false, | ||
|
||
plugins: [ | ||
require('../../lib/index.js'), | ||
'karma-chrome-launcher' | ||
] | ||
}) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
QUnit.test('it works', function (assert) { | ||
assert.expect(1) | ||
assert.strictEqual(1 + 1, 2) | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"env": { | ||
"mocha": true | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
var initQunit = require('../../lib')['framework:qunit'][1] | ||
var expect = require('chai').expect | ||
|
||
describe('framework:qunit', function () { | ||
var files | ||
|
||
beforeEach(function () { | ||
files = [] | ||
}) | ||
|
||
it('should add adapter.js', function () { | ||
initQunit(files) | ||
|
||
expect(files[1].pattern).to.contain('adapter.js') | ||
}) | ||
|
||
it('should add qunit.js', function () { | ||
initQunit(files) | ||
|
||
expect(files[0].pattern).to.contain('qunit.js') | ||
}) | ||
|
||
it('should add qunit.css if we define showUI in config', function () { | ||
var qunitConfig = {showUI: true} | ||
|
||
initQunit(files, qunitConfig) | ||
|
||
expect(files[0].pattern).to.contain('qunit.css') | ||
}) | ||
}) |
File renamed without changes.
File renamed without changes.
File renamed without changes.