Replace grunt with npm scripts
This commit is contained in:
parent
2fcedd9f09
commit
5674a2e8c9
@ -15,6 +15,8 @@
|
|||||||
"esnext": true,
|
"esnext": true,
|
||||||
|
|
||||||
"globals": {
|
"globals": {
|
||||||
|
"expect": true,
|
||||||
|
"sinon": true,
|
||||||
"describe" : true,
|
"describe" : true,
|
||||||
"it" : true,
|
"it" : true,
|
||||||
"before" : true,
|
"before" : true,
|
||||||
|
41
Gruntfile.js
41
Gruntfile.js
@ -1,41 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
module.exports = function(grunt) {
|
|
||||||
|
|
||||||
grunt.initConfig({
|
|
||||||
jshint: {
|
|
||||||
all: ['*.js', 'src/**/*.js', 'test/**/*.js'],
|
|
||||||
options: {
|
|
||||||
jshintrc: '.jshintrc'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
jscs: {
|
|
||||||
src: ['*.js', 'src/**/*.js', 'test/**/*.js'],
|
|
||||||
options: {
|
|
||||||
config: ".jscsrc"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
mochaTest: {
|
|
||||||
test: {
|
|
||||||
options: {
|
|
||||||
reporter: 'spec'
|
|
||||||
},
|
|
||||||
src: [
|
|
||||||
'test/unit/*.js',
|
|
||||||
'test/integration/*.js',
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Load the plugin(s)
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
|
||||||
grunt.loadNpmTasks('grunt-jscs');
|
|
||||||
grunt.loadNpmTasks('grunt-mocha-test');
|
|
||||||
|
|
||||||
// Default task(s).
|
|
||||||
grunt.registerTask('test', ['jshint', 'jscs', 'mochaTest']);
|
|
||||||
|
|
||||||
};
|
|
12
package.json
12
package.json
@ -11,7 +11,11 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": ": ${NODE_ENV=development} && node index.js",
|
"start": ": ${NODE_ENV=development} && node index.js",
|
||||||
"test": ": ${NODE_ENV=development} && grunt test"
|
"test": ": ${NODE_ENV=development} && npm run test:jshint && npm run test:jscs && npm run test:unit && npm run test:integration",
|
||||||
|
"test:jshint": "jshint *.js src/**/*.js test/**/*.js",
|
||||||
|
"test:jscs": "jscs *.js src/**/*.js test/**/*.js",
|
||||||
|
"test:unit": "mocha --opts test/mocha.opts ./test/unit/",
|
||||||
|
"test:integration": "mocha --opts test/mocha.opts ./test/integration"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"addressparser": "^1.0.1",
|
"addressparser": "^1.0.1",
|
||||||
@ -30,10 +34,8 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"chai": "^3.5.0",
|
"chai": "^3.5.0",
|
||||||
"co-mocha": "^1.1.2",
|
"co-mocha": "^1.1.2",
|
||||||
"grunt": "^1.0.1",
|
"jscs": "^3.0.7",
|
||||||
"grunt-contrib-jshint": "^1.0.0",
|
"jshint": "^2.9.4",
|
||||||
"grunt-jscs": "^3.0.1",
|
|
||||||
"grunt-mocha-test": "^0.13.2",
|
|
||||||
"mocha": "^3.2.0",
|
"mocha": "^3.2.0",
|
||||||
"sinon": "^1.17.4",
|
"sinon": "^1.17.4",
|
||||||
"supertest": "^2.0.1"
|
"supertest": "^2.0.1"
|
||||||
|
@ -1,14 +1,10 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
require('co-mocha')(require('mocha')); // monkey patch mocha for generators
|
|
||||||
|
|
||||||
const request = require('supertest');
|
const request = require('supertest');
|
||||||
const Mongo = require('../../src/dao/mongo');
|
const Mongo = require('../../src/dao/mongo');
|
||||||
const nodemailer = require('nodemailer');
|
const nodemailer = require('nodemailer');
|
||||||
const config = require('config');
|
const config = require('config');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const expect = require('chai').expect;
|
|
||||||
const sinon = require('sinon');
|
|
||||||
|
|
||||||
describe('Koa App (HTTP Server) Integration Tests', function() {
|
describe('Koa App (HTTP Server) Integration Tests', function() {
|
||||||
this.timeout(20000);
|
this.timeout(20000);
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
require('co-mocha')(require('mocha')); // monkey patch mocha for generators
|
|
||||||
|
|
||||||
const expect = require('chai').expect;
|
|
||||||
const config = require('config');
|
const config = require('config');
|
||||||
const Email = require('../../src/email/email');
|
const Email = require('../../src/email/email');
|
||||||
const tpl = require('../../src/email/templates.json');
|
const tpl = require('../../src/email/templates.json');
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
require('co-mocha')(require('mocha')); // monkey patch mocha for generators
|
|
||||||
|
|
||||||
const config = require('config');
|
const config = require('config');
|
||||||
const Mongo = require('../../src/dao/mongo');
|
const Mongo = require('../../src/dao/mongo');
|
||||||
const expect = require('chai').expect;
|
|
||||||
|
|
||||||
describe('Mongo Integration Tests', function() {
|
describe('Mongo Integration Tests', function() {
|
||||||
this.timeout(20000);
|
this.timeout(20000);
|
||||||
|
@ -1,15 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
require('co-mocha')(require('mocha')); // monkey patch mocha for generators
|
|
||||||
|
|
||||||
const config = require('config');
|
const config = require('config');
|
||||||
const nodemailer = require('nodemailer');
|
const nodemailer = require('nodemailer');
|
||||||
const Email = require('../../src/email/email');
|
const Email = require('../../src/email/email');
|
||||||
const Mongo = require('../../src/dao/mongo');
|
const Mongo = require('../../src/dao/mongo');
|
||||||
const PGP = require('../../src/service/pgp');
|
const PGP = require('../../src/service/pgp');
|
||||||
const PublicKey = require('../../src/service/public-key');
|
const PublicKey = require('../../src/service/public-key');
|
||||||
const expect = require('chai').expect;
|
|
||||||
const sinon = require('sinon');
|
|
||||||
|
|
||||||
describe('Public Key Integration Tests', function() {
|
describe('Public Key Integration Tests', function() {
|
||||||
this.timeout(20000);
|
this.timeout(20000);
|
||||||
|
2
test/mocha.opts
Normal file
2
test/mocha.opts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
--recursive
|
||||||
|
-r ./test/setup.js
|
9
test/setup.js
Normal file
9
test/setup.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
require('co-mocha')(require('mocha')); // monkey patch mocha for generators
|
||||||
|
|
||||||
|
const expect = require('chai').expect;
|
||||||
|
const sinon = require('sinon');
|
||||||
|
|
||||||
|
global.expect = expect;
|
||||||
|
global.sinon = sinon;
|
@ -1,13 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
require('co-mocha')(require('mocha')); // monkey patch mocha for generators
|
|
||||||
|
|
||||||
const expect = require('chai').expect;
|
|
||||||
const log = require('npmlog');
|
const log = require('npmlog');
|
||||||
const Email = require('../../src/email/email');
|
const Email = require('../../src/email/email');
|
||||||
const nodemailer = require('nodemailer');
|
const nodemailer = require('nodemailer');
|
||||||
const sinon = require('sinon');
|
|
||||||
|
|
||||||
|
|
||||||
describe('Email Unit Tests', () => {
|
describe('Email Unit Tests', () => {
|
||||||
let email, sendFnStub;
|
let email, sendFnStub;
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const expect = require('chai').expect;
|
|
||||||
const log = require('npmlog');
|
const log = require('npmlog');
|
||||||
const openpgp = require('openpgp');
|
const openpgp = require('openpgp');
|
||||||
const PGP = require('../../src/service/pgp');
|
const PGP = require('../../src/service/pgp');
|
||||||
const sinon = require('sinon');
|
|
||||||
|
|
||||||
describe('PGP Unit Tests', () => {
|
describe('PGP Unit Tests', () => {
|
||||||
let pgp, key1Armored, key2Armored, key3Armored;
|
let pgp, key1Armored, key2Armored, key3Armored;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const expect = require('chai').expect;
|
|
||||||
const util = require('../../src/service/util');
|
const util = require('../../src/service/util');
|
||||||
|
|
||||||
describe('Util Unit Tests', () => {
|
describe('Util Unit Tests', () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user