Skip to content

Commit f3c4f08

Browse files
authored
Merge pull request #11 from mjurczyk/feature/adjust-test-files
Feature/adjust test files
2 parents 866d37e + 0d1e946 commit f3c4f08

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ node_modules/
44
.nyc_output/
55
coverage/
66
*.tgz
7-
src/.user-config.json
7+
src/.user-config.json
8+
.user-config.json

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"lint:fix": "npm run lint -- --fix",
1414
"test": "cross-env BABEL_ENV=test npm run test:unit",
1515
"test:watch": "cross-env BABEL_ENV=test npm run test:unit -- -w -R dot",
16-
"test:unit": "mocha --compilers js:babel-core/register test/**/*.spec.js --require babel-polyfill",
16+
"test:unit": "mocha --compilers js:babel-core/register 'test/**/*.spec.js' --require babel-polyfill",
1717
"test:live": "npm run test && npm run build && npm pack && npm install -g json-viewer-*.tgz",
1818
"coverage": "cross-env BABEL_ENV=test nyc --reporter=lcov npm run test:unit",
1919
"coverage:html": "cross-env BABEL_ENV=test nyc --reporter=html npm run test:unit"

test/unit/json-viewer.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('json-viewer', () => {
88
});
99

1010
it('should return proper json property passed in params', () => {
11-
const mockConfigPath = path.resolve(`${__dirname}/../helpers/mock/config.file.mock.json`);
11+
const mockConfigPath = path.resolve(process.cwd(), 'test/helpers/mock/config.file.mock.json');
1212
const params = {
1313
_: [
1414
mockConfigPath,

test/unit/utils/config.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ describe('config', () => {
1818
});
1919

2020
describe('getUserConfig', () => {
21-
const jsMockConfigPath = path.resolve(`${__dirname}/../helpers/mock/config.file.mock.js`);
22-
const jsonMockConfigPath = path.resolve(`${__dirname}/../helpers/mock/config.file.mock.json`);
21+
const jsMockConfigPath = path.resolve(process.cwd(), 'test/helpers/mock/config.file.mock.js');
22+
const jsonMockConfigPath = path.resolve(process.cwd(), 'test/helpers/mock/config.file.mock.json');
2323

2424
it('should return some user config', () => {
2525
const userConfig = getUserConfig();

0 commit comments

Comments
 (0)