Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Refactor coverage tests and updatetest dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Ware <[email protected]>
  • Loading branch information
srware committed Jul 19, 2019
1 parent 57f5328 commit 57c4005
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 39 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ results
node_modules
*.idea/*
*.orig
*/coverage/*
*/dist/*
coverage
dist
*~
config/config.json
data/*
40 changes: 14 additions & 26 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,38 +50,26 @@ module.exports = function(grunt) {
}
}
},
mocha_istanbul: {
local: {
src: 'test/', // the folder, not the files
nyc: {
all: {
options: {
ui: 'bdd',
coverage: true,
include: ['bin/**', 'lib/**', 'modules/**'],
recursive: true,
reporter: 'list',
timeout: 20000,
mask: '*Tests.js',
check: {
lines: 60,
statements: 60,
function: 60
},
root: '.', // define where the cover task should consider the root of libraries that are covered by tests
coverageFolder: 'dist/coverage',
reportFormats: ['lcov']
}
},

reporter: ['lcov', 'text-summary'],
reportDir: 'dist/coverage',
tempDir: 'dist/temp',
all: true
},
cmd: false,
args: ['mocha'],
rawArgs: ['--colors']
}
}
});

grunt.event.on('coverage', function(lcovFileContents, done) {
// Check below
done();
});

grunt.loadNpmTasks('gruntify-eslint');
grunt.loadNpmTasks('grunt-mocha-istanbul');
grunt.loadNpmTasks('grunt-simple-nyc');

// Default task(s).
grunt.registerTask('default', ['eslint:local', 'eslint:tests', 'mocha_istanbul:local']);
grunt.registerTask('default', ['eslint:local', 'eslint:tests', 'nyc:all']);
};
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"bin": {
"oisp-cli": "./oisp-cli.js"
},
"scripts": {},
"scripts": {
"test": "grunt"
},
"repository": {
"type": "git",
"url": "git://github.com/Open-IoT-Service-Platform/oisp-cli.git"
Expand All @@ -28,16 +30,14 @@
},
"homepage": "https://github.com/Open-IoT-Service-Platform/oisp-cli",
"devDependencies": {
"chai": "^4.1.2",
"grunt": "^1.0.1",
"grunt-cli": "^1.2.0",
"gruntify-eslint": "^4.0.0",
"grunt-mocha-istanbul": "^5.0.2",
"istanbul": "^0.4.5",
"mocha": "^4.0.1",
"rewire": "^2.5.2",
"sinon": "^4.1.1",
"uuid": "^3.1.0"
"chai": "^4.2.0",
"grunt": "^1.0.4",
"grunt-cli": "^1.3.2",
"grunt-simple-nyc": "^3.0.0",
"gruntify-eslint": "^5.0.0",
"rewire": "^4.0.1",
"sinon": "^7.3.2",
"uuid": "^3.3.2"
},
"directories": {}
}

0 comments on commit 57c4005

Please sign in to comment.