Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add first round of tests * Add more unit tests * Add pull request testing workflow and clean all eslint errors * Move cognitive complexity rule to .eslintrc and make it a warning not an error * Add coverage to tests * Add more tests * Fix broken code * Fix pull request testing workflow * Fix tests * Trigger CI * Trigger CI * fix linter
- Loading branch information
Showing
14 changed files
with
7,762 additions
and
2,227 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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Pull request testing | ||
|
||
on: | ||
pull_request | ||
|
||
jobs: | ||
release: | ||
name: 'Run linter and tests' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 13 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Run linter | ||
run: npm run lint | ||
- name: Run tests | ||
run: npm test |
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 |
---|---|---|
|
@@ -13,3 +13,4 @@ output | |
*.ids | ||
*.orig | ||
out/ | ||
coverage |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
clearMocks: true, | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const filtersRegistry = jest.genMockFromModule('../filtersRegistry'); | ||
|
||
module.exports = filtersRegistry; |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const utils = jest.genMockFromModule('../utils'); | ||
|
||
utils.__files = {}; | ||
utils.readFile = jest.fn(async (filePath) => { | ||
return utils.__files[filePath]; | ||
}); | ||
|
||
utils.__isFileSystemPathValue = false; | ||
utils.isFileSystemPath = jest.fn(() => utils.__isFileSystemPathValue); | ||
|
||
utils.__isLocalTemplateValue = false; | ||
utils.isLocalTemplate = jest.fn(async () => utils.__isLocalTemplateValue); | ||
|
||
utils.getLocalTemplateDetails = jest.fn(async () => ({ | ||
resolvedLink: utils.__getLocalTemplateDetailsResolvedLinkValue || '', | ||
})); | ||
|
||
module.exports = utils; |
Oops, something went wrong.