Skip to content

Commit

Permalink
add html testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Cap32 committed Feb 17, 2017
1 parent 24f86ad commit 7bb7627
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default (config) => {

// list of files / patterns to load in the browser
files: [
'index.html',
'index.js',
],

Expand All @@ -29,6 +30,7 @@ export default (config) => {
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'index.js': ['webpack'],
'index.html': ['html2js'],
},


Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"eslint-plugin-import": "^2.2.0",
"karma": "^1.3.0",
"karma-chrome-launcher": "^2.0.0",
"karma-html2js-preprocessor": "^1.1.0",
"karma-mocha": "^1.2.0",
"karma-mocha-reporter": "^2.2.0",
"karma-webpack": "^1.8.0",
Expand Down
1 change: 1 addition & 0 deletions test/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>hello world</h1>
1 change: 1 addition & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import lib from '../src';

describe('library', function () {
it('task', function () {
document.body.innerHTML = window.__html__['index.html'];
assert(lib());
});
});
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2427,6 +2427,10 @@ karma-chrome-launcher@^2.0.0:
fs-access "^1.0.0"
which "^1.2.1"

karma-html2js-preprocessor@^1.1.0:
version "1.1.0"
resolved "http://registry.npm.taobao.org/karma-html2js-preprocessor/download/karma-html2js-preprocessor-1.1.0.tgz#fc09edf04bbe2bb6eee9ba1968f826b7388020bd"

karma-mocha-reporter@^2.2.0:
version "2.2.2"
resolved "http://registry.npm.taobao.org/karma-mocha-reporter/download/karma-mocha-reporter-2.2.2.tgz#876de9a287244e54a608591732a98e66611f6abe"
Expand Down

0 comments on commit 7bb7627

Please sign in to comment.