Get started with jasmine CDN
MIT licensed
Jasmine is a popular JS testing framework that provides a behavior-driven development approach to writing and executing tests.
Tags:- bdd
- testing
Stable version
Copied!
How to start using jasmine CDN
// Include Jasmine library from the CDN
const Jasmine = (() => {
const script = document.createElement('script');
script.src = 'https://cdn.cdnhub.io/jasmine/5.1.2/jasmine.min.js';
document.head.appendChild(script);
return new Promise((resolve) => {
script.onload = () => {
resolve(window.jasmine);
};
});
})();
// Your code to test
const add = (a, b) => a + b;
// Define your test spec
Jasmine.specs('Addition', () => {
describe('add', () => {
it('should correctly add two numbers', () => {
expect(add(1, 2)).toEqual(3);
expect(add(5, 3)).toEqual(8);
});
});
});
// Run the tests
Jasmine.execute();
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
All versions
1.1.0
1.1.0.rc1
1.1.0.rc2
1.1.0.rc3
1.1.0.rc4
1.2.0
1.2.0.rc1
1.2.0.rc2
1.2.0.rc3
1.3.0
1.3.1
2.0.0
2.0.0.rc1
2.0.0.rc2
2.0.0.rc3
2.0.0.rc5
2.0.1
2.0.2
2.0.3
2.0.4
2.1.0
2.1.1
2.1.2
2.1.3
2.2.0
2.2.1
2.3.0
2.3.1
2.3.2
2.3.3
2.3.4
2.4.0
2.4.1
2.5.0
2.5.1
2.5.2
2.6.0
2.6.1
2.6.2
2.6.3
2.6.4
2.7.0
2.8.0
2.9.0
2.9.1
2.99.0
2.99.1
2.99.2
3.0.0
3.1.0
3.10.0
3.10.1
3.2.0
3.2.1
3.3.0
3.4.0
3.5.0
3.6.0
3.7.0
3.7.1
3.8.0
3.9.0
3.99.0
3.99.1
4.0.0
4.0.1
4.1.0
4.1.1
4.2.0
4.3.0
4.4.0
4.5.0
4.6.0
4.6.1
5.0.0
5.0.0-alpha.0
5.0.0-alpha.1
5.0.0-beta.0
5.0.1
5.1.0
5.1.1
5.1.2
5.2.0
5.3.0
5.4.0
*** 5.5.0