Skip to content

Commit 641994a

Browse files
Merge pull request #3 from eugene-matvejev/v1.1
basic tests
2 parents 9a6a1c1 + 502e24f commit 641994a

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
"version": "0.1.0",
44
"description": "build .json files which can be used as settings",
55
"main": "index.js",
6-
"scripts": {
7-
"test": "in progress"
8-
},
96
"repository": {
107
"type": "git",
118
"url": "git+https://github.com/explore-node-js/node.js-parameter-handler.git"
@@ -22,5 +19,11 @@
2219
"dependencies": {
2320
"deepmerge": "^1.3.1",
2421
"jsonfile": "^2.4.0"
22+
},
23+
"devDependencies": {
24+
"jest": "^18.1.0"
25+
},
26+
"scripts": {
27+
"test": "node node_modules/jest/bin/jest.js"
2528
}
2629
}

tests/processor.test.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"use strict";
2+
3+
const Processor = require('../src/processor');
4+
const config = require('./fixtures/package.json').extra.node_parameter_handler;
5+
const cwd = process.cwd();
6+
7+
describe('processor', () => {
8+
describe('::resolvePath', () => {
9+
const processor = new Processor(config, cwd);
10+
11+
[ '/', 'test', 'test/', 'test/test', '/test/test' ].forEach(path => {
12+
it(`should be converted '${path}' to absolute path`, () => {
13+
expect(processor.resolvePath(path)).toMatch(/^\/.*/);
14+
})
15+
});
16+
})
17+
});

0 commit comments

Comments
 (0)