Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
1,748 additions
and
0 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
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,24 @@ | ||
language: node_js | ||
node_js: | ||
- "7" | ||
dist: trusty | ||
sudo: false | ||
#addons: | ||
# chrome: stable | ||
git: | ||
depth: 1 | ||
cache: | ||
directories: | ||
- node_modules | ||
# before_install: | ||
# - # start your web application and listen on `localhost:3000` | ||
# - google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost:3000 | ||
install: | ||
- npm install | ||
script: | ||
- npm run test | ||
# after_success: | ||
# - ./travis/deploy_pr_gae.sh | ||
# - export LH_MIN_PASS_SCORE=96 | ||
# - export LH_TEST_URL=https://lighthouse-ci-staging-dot-cr-status.appspot.com/features | ||
# - node node_modules/lighthouse-ci/runlighthouse.js --runner=wpt --score=$LH_MIN_PASS_SCORE $LH_TEST_URL |
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,26 @@ | ||
module.exports = function(config) { | ||
config.set({ | ||
frameworks: ['mocha', 'chai'], | ||
files: [ | ||
'test/**/*.js' | ||
], | ||
reporters: ['progress'], | ||
port: 9876, // karma web server port | ||
colors: true, | ||
logLevel: config.LOG_INFO, | ||
|
||
browsers: ['Chrome', 'ChromeHeadless', 'MyHeadlessChrome'], | ||
customLaunchers: { | ||
MyHeadlessChrome: { | ||
base: 'ChromeHeadless', | ||
flags: ['--disable-translate', '--disable-extensions', | ||
'--no-first-run', '--disable-background-networking', | ||
'--remote-debugging-port=9223'] | ||
} | ||
}, | ||
|
||
autoWatch: false, | ||
// singleRun: false, // Karma captures browsers, runs the tests and exits | ||
concurrency: Infinity | ||
}) | ||
} |
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,20 @@ | ||
{ | ||
"name": "headless-karma-travis", | ||
"private": true, | ||
"version": "0.0.1", | ||
"main": "index.js", | ||
"repository": "https://github.com/ebidel/headless-karma-travis", | ||
"author": "Eric Bidelman <ebidel@gmail.com>", | ||
"license": "Apache-2.0", | ||
"scripts": { | ||
"test": "karma start --single-run --browsers MyHeadlessChrome karma.conf.js" | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.0.2", | ||
"karma": "^1.7.0", | ||
"karma-chai": "^0.1.0", | ||
"karma-chrome-launcher": "^2.1.1", | ||
"karma-mocha": "^1.3.0", | ||
"mocha": "^3.4.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Mocha Tests</title> | ||
<link rel="stylesheet" href="/node_modules/mocha/mocha.css"> | ||
</head> | ||
<body> | ||
<div id="mocha"></div> | ||
<script src="/node_modules/mocha/mocha.js"></script> | ||
<script src="/node_modules/chai/chai.js"></script> | ||
<script>mocha.setup('bdd');</script> | ||
<script src="test.js"></script> | ||
<script> | ||
mocha.run(); | ||
</script> | ||
</body> | ||
</html> |
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,9 @@ | ||
// const assert = chai.assert; | ||
|
||
describe('Array', () => { | ||
describe('#indexOf()', () => { | ||
it('should return -1 when the value is not present', () => { | ||
assert.equal(-1, [1,2,3].indexOf(4)); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.