-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored the way cli config file is read because it was causing sco…
…pe pollution when running tests, added more tests for addClint
- Loading branch information
Showing
10 changed files
with
147 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
{ | ||
"config": { | ||
"filePath": null | ||
} | ||
}, | ||
"queries": [], | ||
"dataClients": [], | ||
"jsonConfig": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
const HOMEDIR = require('os').homedir(); | ||
const path = require('path'); | ||
const logging = require('debug')('Weaver:bin:__tests__:options:shared'); | ||
const { | ||
absPathname, | ||
getJSONContent, | ||
} = require('../../options/shared'); | ||
|
||
const MOCKS_DIR = path.resolve(__dirname, '../__mock__'); | ||
|
||
describe('weaver argument parser tests', () => { | ||
beforeAll(() => { | ||
logging('beforeAll'); | ||
}); | ||
|
||
test('Base behavior', () => { | ||
const invalid = `${HOMEDIR}/random/.weaver.json`; | ||
const valid = `${MOCKS_DIR}/.weaver.mock.json`; | ||
expect(absPathname(process.env.PWD)).toEqual(process.env.PWD); | ||
expect(getJSONContent(invalid)).toEqual(null); | ||
expect(getJSONContent(valid)).not.toEqual(null); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.