-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
15 changed files
with
1,126 additions
and
36 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Unit test | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: read | ||
steps: | ||
- uses: actions/checkout@v3 | ||
# Setup .npmrc file to publish to GitHub Packages | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16.x" | ||
registry-url: "https://npm.pkg.github.com" | ||
# Defaults to the user or organization that owns the workflow file | ||
scope: "@agoraio-extensions" | ||
|
||
- name: Run unit test | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
npm install | ||
npm run 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,18 @@ | ||
export const parseMock = jest.fn(); | ||
// export const generateCustomNodesMock = jest.fn(); | ||
jest.mock('@agoraio-extensions/cxx-parser', () => { | ||
const originalModule = jest.requireActual('@agoraio-extensions/cxx-parser'); | ||
return { | ||
__esModule: true, | ||
...originalModule, | ||
CXXParser: parseMock, | ||
}; | ||
}); | ||
|
||
import * as Tester from '../../parsers/add_node_parser'; | ||
|
||
export const generateCustomNodesMock = jest.spyOn( | ||
Tester, | ||
'generateCustomNodes' | ||
); | ||
export const AddNodeParser = Tester.AddNodeParser; |
Oops, something went wrong.