-
Notifications
You must be signed in to change notification settings - Fork 31
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
1 parent
08622f1
commit 9e574b9
Showing
7 changed files
with
160 additions
and
108 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,19 @@ | ||
language: node_js | ||
node_js: | ||
- "10" | ||
dist: trusty # needs Ubuntu Trusty | ||
# Note: if you switch to sudo: false, you'll need to launch Chrome with --no-sandbox. | ||
# See https://github.com/travis-ci/travis-ci/issues/8836 | ||
sudo: required | ||
addons: | ||
chrome: stable # have Travis install Chrome stable. | ||
cache: | ||
npm: false | ||
directories: | ||
- node_modules | ||
script: | ||
- npm install | ||
#- npm install karma --save-dev | ||
#- npm install karma-qunit karma-requirejs qunit requirejs karma-chrome-launcher --save-dev | ||
- npm install -g karma-cli | ||
- npm test |
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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
// Karma configuration | ||
// Generated on Tue Aug 27 2019 05:27:59 GMT-0700 (PDT) | ||
|
||
module.exports = function(config) { | ||
config.set({ | ||
|
||
// base path that will be used to resolve all patterns (eg. files, exclude) | ||
basePath: '', | ||
|
||
|
||
// frameworks to use | ||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter | ||
frameworks: [], | ||
|
||
|
||
// list of files / patterns to load in the browser | ||
files: [ | ||
/* QUnit */ | ||
'node_modules/qunit/qunit/qunit.js', | ||
'node_modules/qunit/qunit/qunit.css', | ||
'node_modules/karma-qunit/lib/adapter.js', | ||
|
||
/* requireJS */ | ||
'node_modules/requirejs/require.js', | ||
'node_modules/karma-requirejs/lib/adapter.js', | ||
|
||
'tests/test-main.js', | ||
{ pattern: 'tests/test-hello.js', included: false }, | ||
|
||
/* source and vendor js files for empress */ | ||
// { pattern: '../empress/support_files/js/*.js', included: false }, | ||
// { pattern: '../empress/support_files/vendor/*.js', included: false } | ||
], | ||
|
||
|
||
// list of files / patterns to exclude | ||
exclude: [ | ||
], | ||
|
||
// preprocess matching files before serving them to the browser | ||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | ||
preprocessors: { | ||
}, | ||
|
||
|
||
// test results reporter to use | ||
// possible values: 'dots', 'progress' | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
reporters: ['progress'], | ||
|
||
|
||
// web server port | ||
port: 9876, | ||
|
||
|
||
// enable / disable colors in the output (reporters and logs) | ||
colors: true, | ||
|
||
|
||
// level of logging | ||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
logLevel: config.LOG_INFO, | ||
|
||
|
||
// enable / disable watching file and executing tests whenever any file changes | ||
autoWatch: true, | ||
|
||
|
||
// start these browsers | ||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
// browsers: ['ChromeHeadless', 'Chrome'], | ||
browsers: ['ChromeHeadless'], | ||
|
||
|
||
// Continuous Integration mode | ||
// if true, Karma captures browsers, runs the tests and exits | ||
singleRun: false, | ||
|
||
// Concurrency level | ||
// how many browser should be started simultaneous | ||
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,16 @@ | ||
{ | ||
"name": "headless-karma-travis", | ||
"main": "tests/test-main.js", | ||
"author": "Kalen Cantrell", | ||
"scripts": { | ||
"test": "karma start --single-run --browsers ChromeHeadless karma.conf.js" | ||
}, | ||
"devDependencies": { | ||
"karma": "^4.2.0", | ||
"karma-chrome-launcher": "^3.1.0", | ||
"karma-qunit": "^4.0.0", | ||
"karma-requirejs": "^1.1.0", | ||
"qunit": "^2.9.2", | ||
"requirejs": "^2.3.6" | ||
} | ||
} |
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,9 @@ | ||
/* Hello world test for headless chrome test */ | ||
|
||
require([], function() { | ||
// $(document).ready(function() { | ||
QUnit.test('hello world', function(assert) { | ||
assert.equal(1,1,'works'); | ||
}); | ||
// }); | ||
}) |
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,32 @@ | ||
var allTestFiles = [] | ||
var TEST_REGEXP = /test/ | ||
|
||
// Get a list of all the test files to include | ||
// This will be usefull to only load tests files once the soure and vendor files | ||
// are used | ||
Object.keys(window.__karma__.files).forEach(function (file) { | ||
if (TEST_REGEXP.test(file)) { | ||
// console.log(file) | ||
// Normalize paths to RequireJS module names. | ||
// If you require sub-dependencies of test files to be loaded as-is (requiring file extension) | ||
// then do not normalize the paths | ||
var normalizedTestModule = file.replace(/^\/base\/|\.js$/g, '') | ||
allTestFiles.push(normalizedTestModule) | ||
} | ||
}) | ||
|
||
// QUnit.config.autostart = false; | ||
require.config({ | ||
// Karma serves files under /base, which is the basePath from your config file | ||
baseUrl: '/base', | ||
|
||
shim: { | ||
'qunit' : {exports : 'qunit'} | ||
}, | ||
|
||
// dynamically load all test files | ||
deps: ['tests/test-hello'], | ||
|
||
// we have to kickoff jasmine, as it is asynchronous | ||
callback: window.__karma__.start | ||
}); |