https://github.com/dfkaye/testem-jasmine2
[OBSOLETE] ~ configure testem to launch with jasmine 2.0.0
https://github.com/dfkaye/testem-jasmine2
Last synced: 3 months ago
JSON representation
[OBSOLETE] ~ configure testem to launch with jasmine 2.0.0
- Host: GitHub
- URL: https://github.com/dfkaye/testem-jasmine2
- Owner: dfkaye
- Created: 2013-10-16T21:31:40.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-06T19:08:11.000Z (over 11 years ago)
- Last Synced: 2025-01-02T03:46:36.195Z (5 months ago)
- Language: JavaScript
- Homepage:
- Size: 223 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# deprecated / obsolete as of 20 JAN 2014
*[testem](https://github.com/airportyh/testem) supports jasmines 2.0 as of v __0.6.3__*
hack instructions below for historical reference only
...
testem-jasmine2
===============Quick hack to configure [testem](https://github.com/airportyh/testem) to launch
with jasmine2.*Note: does not hack on jasmine-node, as that's a separate project with its own
jasmine-lib version.**Note to self: send pull request to toby once jasmine2 is stabilized*
1. install or update testem
npm install -g testem
npm update -g testem2. acquire standalone jasmine 2 release zip file at
[https://github.com/pivotal/jasmine/tree/master/dist](https://github.com/pivotal/jasmine/tree/master/dist)or use the jasmine-2.0.0 files on this repo.
3. cd to your global
npm/node_modules/testem
directory.Yes, we're going to hack testem - forgive me.
4.
mkdir ./public/testem/jasmine2
5. copy these files from the jasmine-2.0.0
/lib
directory, to
public/testem/jasmine2
:boot.js
console.js
jasmine.css
jasmine.js
jasmine-favicon.png
jasmine-html.js
6. createjasmine2runner.mustache
from the following source and
save to./testem/views
diror copy from the jasmine2runner.mustache also on this repo:
Test'em with jasmine2
{{#scripts}}{{/scripts}}
{{#styles}}{{/styles}}
7. add a
templateFile
entry in therenderRunnerPage()
method in./testem/lib/server.js
:
, renderRunnerPage: function(err, files, res){
var config = this.config
var framework = config.get('framework') || 'jasmine'
var css_files = config.get('css_files')
var templateFile = {
jasmine: 'jasminerunner'
, 'jasmine2': 'jasmine2runner' // <--- ADD THIS LINE
, qunit: 'qunitrunner'
...8. create a smoke test spec file in your project, or use the
smoke.spec.js
in this repo:describe('jasmine', function () {
it('should find jasmine', function () {
expect(jasmine).toBeDefined();
});
it('should run async with done', function (done) {
var t = 500;
var x = (+new Date());
setTimeout(function() {
y = (+new Date()) - x;
expect(y >= t).toBe(true);
done();
}, t);
});
describe('custom equality matcher for version', function() {beforeEach(function() {
jasmine.addCustomEqualityTester(function partial(first, second) {
if (typeof first == 'string' && typeof second == 'string') {
return first.indexOf(second) === 0;
}
});
});
it('should be 2.0.0', function () {
expect(jasmine.version).toEqual('2.0.0');
});
});
});
9. create testem.json in your project, listing your (or jasmine 2's) specs:{
"framework": "jasmine2",
"src_files" : [
"smoke.spec.js",
"introduction.spec.js",
"custom.matcher.spec.js",
"custom.equality.spec.js"
]
}
10. run from the command line:cd ./your-jasmine2-project
testem
Happy testing with jasmine-2 and testem!