Skip to content

Commit 6fed809

Browse files
committed
chore(ci): start using Mocha for #41
1 parent 5dce4bf commit 6fed809

File tree

4 files changed

+46
-36
lines changed

4 files changed

+46
-36
lines changed

Gruntfile.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ module.exports = function(grunt) {
33

44
grunt.initConfig({
55
pkg: grunt.file.readJSON('package.json'),
6-
complexity: {
7-
default: grunt.file.readJSON('complexity.json')
8-
},
96
'nice-package': {
107
all: {
118
options: {}
@@ -22,5 +19,5 @@ module.exports = function(grunt) {
2219
var plugins = require('matchdep').filterDev('grunt-*');
2320
plugins.forEach(grunt.loadNpmTasks);
2421

25-
grunt.registerTask('default', ['nice-package', 'complexity', 'filenames']);
22+
grunt.registerTask('default', ['nice-package', 'filenames']);
2623
};

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"grunt-nice-package": "0.10.3",
5656
"gt": "0.10.0",
5757
"matchdep": "1.0.1",
58+
"mocha": "3.4.2",
5859
"pkgfiles": "2.3.0",
5960
"pre-git": "3.12.0",
6061
"proxyquire": "1.7.10",
@@ -68,6 +69,7 @@
6869
"files": [
6970
"src/",
7071
"!src/test",
72+
"!src/*-spec.js",
7173
"bin"
7274
],
7375
"homepage": "https://github.com/bahmutov/npm-utils",
@@ -94,9 +96,11 @@
9496
"issues": "git-issues",
9597
"lint": "standard --verbose --fix src/*.js",
9698
"pkgfiles": "pkgfiles",
99+
"posttest": "npm run unit",
97100
"pretest": "npm run lint",
98101
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
99102
"size": "t=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";",
100-
"test": "gt src/test/*.js --output"
103+
"test": "gt src/test/*.js --output",
104+
"unit": "mocha src/*-spec.js"
101105
}
102106
}

src/module-install-spec.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
const la = require('lazy-ass')
2+
const is = require('check-more-types')
3+
4+
/* global describe, it */
5+
describe('module install', () => {
6+
const install = require('./module-install')
7+
// const path = require('path')
8+
9+
it('is a function', () => {
10+
la(is.fn(install))
11+
})
12+
13+
// it('install into tmp folder', function () {
14+
// gt.func(install, 'install is a function');
15+
// var options = {
16+
// name: 'lodash',
17+
// prefix: '/tmp/lodash-prefix/',
18+
// registry: 'http://registry.npmjs.org/'
19+
// };
20+
// install(options).then(function () {
21+
// return path.join(options.prefix, '/lib/node_modules/' + options.name);
22+
// })
23+
// .finally(gt.start)
24+
// .done();
25+
// });
26+
27+
// gt.async('passes command line flags', function () {
28+
// var options = {
29+
// name: 'lodash',
30+
// prefix: '/tmp/lodash-prefix/',
31+
// registry: 'http://registry.npmjs.org/',
32+
// flags: ['--verbose']
33+
// };
34+
// install(options).then(function () {
35+
// return path.join(options.prefix, '/lib/node_modules/' + options.name);
36+
// })
37+
// .finally(gt.start)
38+
// .done();
39+
// });
40+
})

src/test/module-install.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)