Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
ebb713e
install jest
kbonnici Jul 12, 2023
d32c635
wip testing exportProjectsData
kbonnici Jul 12, 2023
241aa1b
ignore errors preventing tests from running
kbonnici Jul 13, 2023
e771d79
mock whoami
kbonnici Jul 13, 2023
fa79c18
add updateProjectMeta as a positional arg to exportProjectsData
kbonnici Jul 24, 2023
2b7df95
add tests for exportProjectsData
kbonnici Jul 24, 2023
661f87b
add test data
kbonnici Jul 25, 2023
f1aaad0
use test data in unit tests
kbonnici Jul 25, 2023
c129570
move added test data into 2nd getState call
kbonnici Jul 25, 2023
b29c059
add test case for when state.whoami is undefined
kbonnici Jul 25, 2023
e48e35e
add integrityVersion to exported data
kbonnici Jul 26, 2023
707d1b2
replace integrity version number with placeholder
kbonnici Jul 26, 2023
a907110
ts-ignore AppWebsocket
kbonnici Jul 26, 2023
a5aa502
define internalImportProjectsData
kbonnici Jul 26, 2023
78f0659
add scaffolding for testing
kbonnici Jul 26, 2023
4fb86e5
figured out problem with jest config through trial and error
Connoropolous Jul 26, 2023
3d43581
clean up ts-ignores
Connoropolous Jul 26, 2023
67ea84c
add installProjectApp as functional dependancy
kbonnici Jul 28, 2023
d4d380f
create sample exported project data
kbonnici Jul 28, 2023
74e0682
add assertions to UT
kbonnici Jul 28, 2023
e323413
add assertions about what arguments should be passed to functional de…
kbonnici Jul 28, 2023
34b0ed0
add assertions about test data
kbonnici Jul 28, 2023
42787f2
remove redundant try-catch logic
kbonnici Jul 28, 2023
5891173
change passphrase on 2nd test project
kbonnici Jul 28, 2023
5367a3f
add test for invalid json
kbonnici Jul 28, 2023
c3deee2
extract functional deps for installProjectAppAndImport()
kbonnici Jul 28, 2023
fd874e4
add unit test for installProjectAppAndImport()
kbonnici Jul 28, 2023
cd03226
Merge branch 'main' into add-jest
Connoropolous Jul 29, 2023
93c89b5
move large test data definitions into their own file
kbonnici Jul 31, 2023
1436a90
remove now un-needed whoami declaration in test file
kbonnici Jul 31, 2023
c41344b
add type annotations to mock project meta and whoami
kbonnici Jul 31, 2023
c3cbdd4
refactor test file to use typeof instead of concrete types
kbonnici Jul 31, 2023
a4a22da
refactor functional dependancies to use typeof
kbonnici Jul 31, 2023
637d8d3
fix test descriptions
kbonnici Jul 31, 2023
d784f88
fix whoami field for mockBaseRootState
kbonnici Jul 31, 2023
3c11a45
add type annotations to mock data in export tests
kbonnici Jul 31, 2023
c4e7016
use typeof instead of concrete types in export.ts
kbonnici Aug 1, 2023
76cdd94
reduce number of calls to ProjectsZomeApi()
kbonnici Aug 1, 2023
5c0bbea
address comments on PR
kbonnici Aug 1, 2023
bd45d62
create populated state variable and add more arg assertions in export…
kbonnici Aug 2, 2023
5303caf
create mock project data variable
kbonnici Aug 2, 2023
6cc8dbc
make updateProjectMeta use typeof
kbonnici Aug 2, 2023
ad68322
add type annotation to testProject
kbonnici Aug 2, 2023
c47d932
remove await keyword behind store.dispatch()
kbonnici Aug 2, 2023
5855c0d
add comments explaining assertion
kbonnici Aug 2, 2023
32065dd
move importProjectData to internal function
kbonnici Aug 2, 2023
8b46448
add more data to sampleGoodUnmigratedProjectData
kbonnici Aug 2, 2023
c0b0ca3
add mock connection, entryPoint, outcome, outcomeComment, outcomeMemb…
kbonnici Aug 2, 2023
c061a63
add type annotation to test comment array
kbonnici Aug 2, 2023
cca3a18
add unit test for importProjectData()
kbonnici Aug 2, 2023
ac850ca
replace hard coded number of calls with number of resources
kbonnici Aug 2, 2023
23e6163
refactor importProjectData to use generic clone logic
kbonnici Aug 2, 2023
293bc4f
add unit test GH actions file
Connoropolous Aug 3, 2023
33b19b5
rename job
Connoropolous Aug 3, 2023
bb653f6
Merge branch 'main' into add-jest
Connoropolous Aug 3, 2023
984f888
remove unnecessary function arg
kbonnici Aug 3, 2023
d21d291
add unit tests for cloneDataSet(), cloneTag(), cloneOutcome(), cloneC…
kbonnici Aug 3, 2023
0840c27
move import file into its own folder
kbonnici Aug 3, 2023
abc3d6e
add zomeApiCreators file
kbonnici Aug 3, 2023
9966210
move clone functions and importProjectData functions into their own f…
kbonnici Aug 3, 2023
8858343
move installProjectAppAndImport() to its own file
kbonnici Aug 3, 2023
adfdaf0
remove unused imports
kbonnici Aug 3, 2023
44b3084
delete try-catch block
kbonnici Aug 3, 2023
fe6ff3f
add more assertions to importProjectsData unit test
kbonnici Aug 3, 2023
d31b458
some minor refactoring
Connoropolous Aug 4, 2023
66f4ec5
add mock actionHashMap for testing
kbonnici Aug 4, 2023
6571bb3
add assertions on result of createActionHashMapAndImportProjectData()
kbonnici Aug 4, 2023
62e7555
pull connors changes
kbonnici Aug 4, 2023
a10d97c
make mockActionHashMap plural
kbonnici Aug 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Unit Tests

on:
push:
branches:
- '*'

jobs:
unit-test:
strategy:
matrix:
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install nodejs dependencies
run: |
npm run web-install
shell: bash
- name: run unit tests
run: |
npm run web-test
shell: bash
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"web3": "cd web && WEB_PORT=8083 ADMIN_WS_PORT=1103 APP_WS_PORT=8103 npx webpack-dev-server --config webpack.dev.js",
"web4": "cd web && WEB_PORT=8084 ADMIN_WS_PORT=1104 APP_WS_PORT=8104 npx webpack-dev-server --config webpack.dev.js",
"web-build": "cd web && npx webpack --config webpack.prod.js",
"web-test": "cd web && npm run test",
"electron-install": "cd electron && npm install",
"electron": "cd electron && WEB_PORT=8081 ACORN_AGENT_NUM=1 npm run start",
"electron2": "cd electron && WEB_PORT=8082 ACORN_AGENT_NUM=2 npm run start",
Expand Down
32 changes: 32 additions & 0 deletions web/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
extensionsToTreatAsEsm: ['.ts'],
transform: {
'^.+\\.[tj]s$': [
'babel-jest',
{
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current',
},
},
],
'@babel/preset-typescript',
],
},
],
},
transformIgnorePatterns: [
'node_modules/(?!((@holochain/(client|serialization))|@noble/ed25519|emittery|lodash-es).*)',
],
globals: {
__MAIN_APP_ID__: 'test-main-app-id',
__ADMIN_PORT__: 'test-admin-port',
__APP_PORT__: 'test-app-port',
},
}
Loading