Skip to content

Commit

Permalink
Jest Setup and Definition of Unit Tests (tinglesoftware#445)
Browse files Browse the repository at this point in the history
* chore: install jest and other packages for unit tests
* chore: uninstall unused ts-node package
* fix: properly define jst config
* test: add unit tests for extractOrganization util function
* test: add unit tests for extractHostname util function
* test: add unit tests for extractVirtualDirectory util function
* chore: add action to run unit tests in build pipeline
* chore: ignore jest files when doing typescript compilation
* chore: create separate action to move node_modules folder in build pipeline
* chore: add separate action to install npm packages in build pipeline
* chore: use Node version 16 in build pipeline
* chore: revert to Node 18 in build pipeline
* chore: install ts-node dev dependency
* chore: remove package-lock.json from gitignore
* Revert "chore: install ts-node dev dependency"
This reverts commit 01d15ae.

Co-authored-by: Elijah Kimani <[email protected]>
  • Loading branch information
elijahkimani and Elijah Kimani authored Dec 21, 2022
1 parent 200a750 commit 2c025a9
Show file tree
Hide file tree
Showing 10 changed files with 7,417 additions and 7 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,22 @@ jobs:
with:
node-version: '18.x'

- name: Install
run: npm install
working-directory: '${{ github.workspace }}/extension'

- name: Test
run: npm run test
working-directory: '${{ github.workspace }}/extension'

- name: Build
run: npm run build:prod
working-directory: '${{ github.workspace }}/extension'

- name: Move node_modules
run: npm run mv:prod
working-directory: '${{ github.workspace }}/extension'

- name: Install tfx-cli
run: npm install -g [email protected]

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,5 @@ build-iPhoneSimulator/

node_modules
dist
package-lock.json
*.log
.idea
14 changes: 14 additions & 0 deletions extension/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Config } from "@jest/types";

// Sync object
const config: Config.InitialOptions = {
verbose: true,
// transform: {
// "^.+\\.test.tsx?$": "ts-jest",
// },
testEnvironment: "node",
preset: "ts-jest",
rootDir: "./tests",
};

export default config;
Loading

0 comments on commit 2c025a9

Please sign in to comment.