Skip to content

Commit 9d7325f

Browse files
basic tests
1 parent 4cd4795 commit 9d7325f

File tree

2 files changed

+30
-10
lines changed

2 files changed

+30
-10
lines changed

package.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
{
2-
"name": "node-parameter-handler",
2+
"name": "node.js-parameter-handler",
33
"version": "0.1.0",
4-
"description": "test",
4+
"description": "build .json files which can be used as settings",
55
"main": "index.js",
6-
"scripts": {
7-
"test": "test"
8-
},
96
"repository": {
107
"type": "git",
11-
"url": "git+https://github.com/eugene-matvejev/node.js-parameter-handler.git"
8+
"url": "git+https://github.com/explore-node-js/node.js-parameter-handler.git"
129
},
1310
"keywords": [
14-
"test"
11+
"config handler, parameter handler"
1512
],
16-
"author": "eugene matvejev",
13+
"author": "Eugene Matvejev <eugene.matvejev@gmail.com>",
1714
"license": "MIT",
1815
"bugs": {
19-
"url": "https://github.com/eugene-matvejev/node.js-parameter-handler/issues"
16+
"url": "https://github.com/explore-node-js/node.js-parameter-handler/issues"
2017
},
21-
"homepage": "https://github.com/eugene-matvejev/node.js-parameter-handler#readme",
18+
"homepage": "https://github.com/explore-node-js/node.js-parameter-handler#readme",
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)