Skip to content

Commit 5aa1833

Browse files
authored
Merge pull request #266 from knockout/bmh/sc-mocha-test-modernization
Complete Jasmine to Mocha test migration
2 parents dd67164 + affc944 commit 5aa1833

151 files changed

Lines changed: 15941 additions & 15265 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,16 @@ Make targets (they include `tools/build.mk`).
9292
## Testing
9393

9494
- **Runner**: Karma
95-
- **Frameworks**: Mocha + Chai + Sinon (preferred for new tests), Jasmine 1.3 (legacy)
95+
- **Frameworks**: Mocha + Chai + Sinon
9696
- **Browsers**: Electron (default), Chrome Headless, Firefox Headless
9797
- **Coverage**: nyc/Istanbul (~89% statements, ~83% branches)
9898
- **Test files**: `packages/*/spec/` directories
9999

100-
When writing new tests, use Mocha/Chai/Sinon (not Jasmine).
100+
Use Mocha/Chai/Sinon for repository tests.
101+
102+
Do not:
103+
- split shared specs into runner-specific versions while they still need to run
104+
in the browser harness
101105

102106
## Code Style
103107

COVERAGE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,5 +173,4 @@ All files | 89.73 | 83.31 | 86.25 | 89.77 |
173173
selectExtensions.js | 97.82 | 96.96 | 100 | 97.61 | 30
174174
virtualElements.js | 93.98 | 91.78 | 94.73 | 94.06 | 143-149,178-179
175175
packages/utils/helpers | 90 | 69.44 | 94.28 | 89.43 |
176-
jasmine-13-helper.ts | 90 | 69.44 | 94.28 | 89.43 | ...165,177,231,256
177-
176+
mocha-test-helpers.ts | 90 | 69.44 | 94.28 | 89.43 | ...165,177,231,256

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Start tests with electron: `make test`
7474

7575
Start tests with headless-chrome: `make test-headless`
7676

77-
The test setup has naturally grown and been ported from knockout.js. Some tests use Jasmine 1.3, newer ones use Mocha, Chai and Sinon. Karma is used as test runner rather as test pipeline
77+
The test setup has been ported from knockout.js and standardized on Mocha, Chai and Sinon. Karma is used as the test runner.
7878

7979
Other options:
8080

@@ -130,10 +130,7 @@ Additionally, implement a well-configured [Content Security Policy (CSP)](https:
130130
- Test-Environment -> electron and headless-chrome
131131
- Linting -> Eslint
132132
- Formatting -> Prettier (configured like StandardJS)
133-
- TDD/BDD-Frameworks ->
134-
- Jasmine 1.3
135-
- Mocha + Chai
136-
- sinon (Mocks)
133+
- TDD/BDD-Frameworks -> Mocha + Chai + Sinon
137134
- Testing-Cloud-Service -> sauce
138135
- standard -> Code-Style (outdated for typescript)
139136

builds/knockout/helpers/jasmine.extensions.js

Lines changed: 0 additions & 209 deletions
This file was deleted.

0 commit comments

Comments
 (0)