Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

719 stop phantom #725

Merged
merged 4 commits into from
Apr 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sudo: false

language: node_js
node_js:
- '8'
- lts/*

# setup the travis token
env:
Expand Down
39 changes: 12 additions & 27 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,14 @@ module.exports = function(grunt) {
jshintrc: '.jshintrc'
}
},
qunit: {
all: ['tests/index.html'],
options: {
'--web-security': 'no',
coverage: {
disposeCollector: true,
src: [ "src/**/*.js" ],
instrumentedFiles: "/tmp/ivmartel/dwv",
htmlReport: "build/report/coverage",
lcovReport: "build/report/lcov",
linesThresholdPct: 0
}
karma: {
unit: {
configFile: 'karma.conf.js',
},
continuous: {
configFile: 'karma.conf.js',
browsers: ['ChromeHeadless'],
singleRun: true,
}
},
coveralls: {
Expand All @@ -32,7 +28,7 @@ module.exports = function(grunt) {
force: true
},
main_target: {
src: "build/report/lcov/lcov.info"
src: "build/coverage/dwv/report-lcovonly.txt"
}
},
concat: {
Expand Down Expand Up @@ -95,32 +91,21 @@ module.exports = function(grunt) {
}
}
},
connect: {
server: {
options: {
port: 8080,
hostname: 'localhost',
open: 'http://localhost:8080/tests/index.html',
livereload: true
}
}
},
});

grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-coveralls');
grunt.loadNpmTasks('grunt-jsdoc');
grunt.loadNpmTasks('grunt-qunit-istanbul');
grunt.loadNpmTasks('grunt-karma');

// tasks
grunt.registerTask('lint', ['jshint']);
grunt.registerTask('test', ['connect', 'watch:lint']);
grunt.registerTask('test-ci', ['qunit']);
grunt.registerTask('test', ['karma:unit']);
grunt.registerTask('test-ci', ['karma:continuous']);
grunt.registerTask('build', ['concat', 'uglify']);
grunt.registerTask('doc', ['jsdoc']);
grunt.registerTask('dev', ['watch:build']);
Expand Down
51 changes: 51 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '.',
frameworks: ['qunit'],
plugins: [
require('karma-qunit'),
require('karma-chrome-launcher'),
require('karma-coverage')
],
files: [
{pattern: 'node_modules/konva/konva.min.js', watched: false},
{pattern: 'node_modules/i18next/i18next.min.js', watched: false},
{pattern: 'node_modules/i18next-xhr-backend/i18nextXHRBackend.min.js', watched: false},
{pattern: 'node_modules/i18next-browser-languagedetector/i18nextBrowserLanguageDetector.min.js', watched: false},
{pattern: 'node_modules/jszip/dist/jszip.js', watched: false},
{pattern: 'locales/**/translation.json', included: false, type: 'js'},
'src/**/*.js',
'tests/**/*.test.js',
'tests/utils/worker.js'
],
proxies: {
"/locales/": "/base/locales/",
"/tests/utils/": "/base/tests/utils/"
},
client: {
clearContext: false,
qunit: {
showUI: true,
testTimeout: 5000
}
},
preprocessors: {
'src/**/*.js': ['coverage']
},
coverageReporter: {
dir: require('path').join(__dirname, './build/coverage/dwv'),
reporters: [
{ type: 'html', subdir: 'report-html' },
{ type: 'lcovonly', subdir: '.', file: 'report-lcovonly.txt' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'coverage'],
logLevel: config.LOG_INFO,
browsers: ['Chrome'],
restartOnFileChange: true
});
};
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,18 @@
"grunt": "~1.0.3",
"grunt-cli": "~1.3.2",
"grunt-contrib-concat": "~1.0.1",
"grunt-contrib-connect": "~2.1.0",
"grunt-contrib-copy": "~1.0.0",
"grunt-contrib-jshint": "~2.1.0",
"grunt-contrib-uglify": "~4.0.0",
"grunt-contrib-watch": "~1.1.0",
"grunt-coveralls": "~2.0.0",
"grunt-jsdoc": "~2.4.0",
"grunt-qunit-istanbul": "~1.0.0",
"grunt-karma": "~3.0.2",
"http-server": "^0.12.1",
"karma": "~4.4.1",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "^2.0.1",
"karma-qunit": "~4.0.0",
"qunit": "~2.9.1"
},
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions tests/dicom/dicomElementsWrapper.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ QUnit.module("dicomElementsWrapper");
* @function module:tests/dicom~dicomElementsWrapper
*/
QUnit.test("Test simple DICOM wrapping.", function (assert) {
assert.timeout(10000);
var done = assert.async();

var request = new XMLHttpRequest();
Expand Down
1 change: 1 addition & 0 deletions tests/dicom/dicomParser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ QUnit.module("dicomParser");
* @function module:tests/dicom~dicomParserSimpleDicom
*/
QUnit.test("Test simple DICOM parsing.", function (assert) {
assert.timeout(10000);
var done = assert.async();

var request = new XMLHttpRequest();
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/thread.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ QUnit.test("Test ThreadPool.", function (assert) {
for ( var i = 0; i < nTestWorkers; ++i ) {
// create worker task
var workerTask = new dwv.utils.WorkerTask(
"./utils/worker.js", {"input": "papageno"}, i);
"/tests/utils/worker.js", {"input": "papageno"}, i);
// add it the queue and run it
pool.addWorkerTask(workerTask);
}
Expand Down
Loading