Configures and runs Jasmine - the original BDD-style JS test framework (predecessor to Jest) with built-in matchers + spies, no external assertion library; ships `jasmine-core` + `jasmine` runner; `spec_dir` + `helpers` convention; `jasmine.json` config; spy patterns (`spyOn`, `createSpy`); pairs with Karma for in-browser testing. Use when the user maintains legacy AngularJS / Karma+Jasmine codebases, or wants minimal BDD-style tests with no third-party assertion library.
75
94%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Deep reference for jasmine-tests SKILL.md. Consult when running Jasmine
specs in a real browser via Karma (the legacy Angular CLI default), or when
moving a Jasmine suite to Jest.
For browser-environment tests (legacy Angular CLI default):
npm install --save-dev karma karma-jasmine karma-chrome-launcherkarma.conf.js:
module.exports = function(config) {
config.set({
frameworks: ['jasmine'],
files: ['src/**/*.spec.js'],
browsers: ['ChromeHeadless'],
singleRun: true,
reporters: ['progress', 'junit'],
});
};npx karma startImportant migration note: Karma is in maintenance-only mode as of 2023; AngularJS reached end-of-life Jan 2022; new Angular projects use Jest or Vitest. Karma + Jasmine setups are explicitly legacy.
Jest's API is mostly compatible with Jasmine - typical migration steps:
spyOn().and.returnValue() with jest.spyOn().mockReturnValue()jasmine.createSpy() with jest.fn()jasmine.createSpyObj() with manual jest.fn() per methodexpect().toBeNan() with expect(Number.isNaN()).toBe(true)
(matcher renamed)jest.config.js with appropriate testMatchFor automated migration: jest-codemods package handles ~80% of the syntax
transformations.