Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89232db2ee | ||
|
|
8b0d9c83bb | ||
|
|
60533ca868 | ||
|
|
048ab728ec | ||
|
|
488df899fb | ||
|
|
753f4b44b4 | ||
|
|
2c23d35b03 | ||
|
|
2b0be0c74b | ||
|
|
b4f49db6bd | ||
|
|
cee3cc56e6 | ||
|
|
f2346d357f | ||
|
|
ee09301d8d | ||
|
|
760b50d969 | ||
|
|
773b15e450 | ||
|
|
7ad261837a |
@@ -16,8 +16,5 @@ jasmine-core.gemspec
|
|||||||
*.sh
|
*.sh
|
||||||
Gruntfile.js
|
Gruntfile.js
|
||||||
lib/jasmine-core/boot/
|
lib/jasmine-core/boot/
|
||||||
lib/jasmine-core/boot.js
|
|
||||||
lib/jasmine-core/spec
|
lib/jasmine-core/spec
|
||||||
lib/jasmine-core/*.css
|
|
||||||
lib/jasmine-core/jasmine-html.js
|
|
||||||
lib/jasmine-core/version.rb
|
lib/jasmine-core/version.rb
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ Jasmine uses Node.js with a custom runner to test outside of a browser.
|
|||||||
## Before Committing or Submitting a Pull Request
|
## Before Committing or Submitting a Pull Request
|
||||||
|
|
||||||
1. Ensure all specs are green in browser *and* node
|
1. Ensure all specs are green in browser *and* node
|
||||||
1. Ensure JSHint is green with `grunt jsHint`
|
1. Ensure JSHint is green with `grunt jshint`
|
||||||
1. Build `jasmine.js` with `grunt buildDistribution` and run all specs again - this ensures that your changes self-test well
|
1. Build `jasmine.js` with `grunt buildDistribution` and run all specs again - this ensures that your changes self-test well
|
||||||
|
|
||||||
## Submitting a Pull Request
|
## Submitting a Pull Request
|
||||||
|
|||||||
13
RELEASE.md
13
RELEASE.md
@@ -21,14 +21,6 @@ This version is used by both `jasmine.js` and the `jasmine-core` Ruby gem.
|
|||||||
|
|
||||||
Note that Jasmine should *not* use the "patch" version number. Let downstream projects rev their patch versions as needed, keeping their major and minor version numbers in sync with Jasmine core.
|
Note that Jasmine should *not* use the "patch" version number. Let downstream projects rev their patch versions as needed, keeping their major and minor version numbers in sync with Jasmine core.
|
||||||
|
|
||||||
### Update the Github Pages (as needed)
|
|
||||||
|
|
||||||
___Note: This is going to change right after 2.0___
|
|
||||||
|
|
||||||
Github pages have to exist in a branch called `gh-pages` in order for their app to serve them. This repo adds that branch as a submodule under the `pages` directory. This is a bit of a hack, but it allows us to work with the pages and the source at the same time and with one set of rake tasks.
|
|
||||||
|
|
||||||
If you want to submit changes to this repo and aren't a Pivotal Labs employee, you can fork and work in the `gh-pages` branch. You won't be able to edit the pages in the submodule off of master.
|
|
||||||
|
|
||||||
## Release
|
## Release
|
||||||
|
|
||||||
When ready to release - specs are all green and the stories are done:
|
When ready to release - specs are all green and the stories are done:
|
||||||
@@ -55,6 +47,11 @@ When ready to release - specs are all green and the stories are done:
|
|||||||
1. Push these changes to GitHub and verify that this SHA is green
|
1. Push these changes to GitHub and verify that this SHA is green
|
||||||
1. `rake release` - tags the repo with the version, builds the `jasmine-core` gem, pushes the gem to Rubygems.org. In order to release you will have to ensure you have rubygems creds locally.
|
1. `rake release` - tags the repo with the version, builds the `jasmine-core` gem, pushes the gem to Rubygems.org. In order to release you will have to ensure you have rubygems creds locally.
|
||||||
|
|
||||||
|
### Release the NPM
|
||||||
|
|
||||||
|
1. `npm adduser` to save your credentials locally
|
||||||
|
1. `npm publish .` to publish what's in `package.json`
|
||||||
|
|
||||||
### Finally
|
### Finally
|
||||||
|
|
||||||
1. Visit the [Releases page for Jasmine](https://github.com/pivotal/jasmine/releases), find the tag just pushed.
|
1. Visit the [Releases page for Jasmine](https://github.com/pivotal/jasmine/releases), find the tag just pushed.
|
||||||
|
|||||||
BIN
dist/jasmine-standalone-2.0.2.zip
vendored
Normal file
BIN
dist/jasmine-standalone-2.0.2.zip
vendored
Normal file
Binary file not shown.
@@ -154,6 +154,7 @@ getJasmineRequireObj().ConsoleReporter = function() {
|
|||||||
for (var i = 0; i < result.failedExpectations.length; i++) {
|
for (var i = 0; i < result.failedExpectations.length; i++) {
|
||||||
var failedExpectation = result.failedExpectations[i];
|
var failedExpectation = result.failedExpectations[i];
|
||||||
printNewline();
|
printNewline();
|
||||||
|
print(indent(failedExpectation.message, 2));
|
||||||
print(indent(failedExpectation.stack, 2));
|
print(indent(failedExpectation.stack, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,29 @@
|
|||||||
module.exports = require("./jasmine-core/jasmine.js");
|
module.exports = require("./jasmine-core/jasmine.js");
|
||||||
module.exports.boot = require('./jasmine-core/node_boot.js');
|
module.exports.boot = require('./jasmine-core/node_boot.js');
|
||||||
|
|
||||||
|
module.exports.files = (function() {
|
||||||
|
var path = require('path'),
|
||||||
|
fs = require('fs'),
|
||||||
|
glob = require('glob');
|
||||||
|
|
||||||
|
var rootPath = path.join(__dirname, "jasmine-core"),
|
||||||
|
bootFiles = ['boot.js'],
|
||||||
|
nodeBootFiles = ['node_boot.js'];
|
||||||
|
|
||||||
|
var cssFiles = glob.sync(path.join(rootPath, '*.css')).map(path.basename);
|
||||||
|
var jsFiles = glob.sync(path.join(rootPath, '*.js')).map(path.basename);
|
||||||
|
|
||||||
|
['jasmine.js'].concat(bootFiles, nodeBootFiles).forEach(function(file) {
|
||||||
|
jsFiles.splice(jsFiles.indexOf(file), 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
path: rootPath,
|
||||||
|
bootDir: rootPath,
|
||||||
|
bootFiles: bootFiles,
|
||||||
|
nodeBootFiles: nodeBootFiles,
|
||||||
|
cssFiles: cssFiles,
|
||||||
|
jsFiles: ['jasmine.js'].concat(jsFiles),
|
||||||
|
imagesDir: path.join(__dirname, '../images')
|
||||||
|
};
|
||||||
|
}());
|
||||||
|
|||||||
@@ -54,47 +54,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||||||
*
|
*
|
||||||
* Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged.
|
* Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged.
|
||||||
*/
|
*/
|
||||||
var jasmineInterface = {
|
var jasmineInterface = jasmineRequire.interface(jasmine, env);
|
||||||
describe: function(description, specDefinitions) {
|
|
||||||
return env.describe(description, specDefinitions);
|
|
||||||
},
|
|
||||||
|
|
||||||
xdescribe: function(description, specDefinitions) {
|
|
||||||
return env.xdescribe(description, specDefinitions);
|
|
||||||
},
|
|
||||||
|
|
||||||
it: function(desc, func) {
|
|
||||||
return env.it(desc, func);
|
|
||||||
},
|
|
||||||
|
|
||||||
xit: function(desc, func) {
|
|
||||||
return env.xit(desc, func);
|
|
||||||
},
|
|
||||||
|
|
||||||
beforeEach: function(beforeEachFunction) {
|
|
||||||
return env.beforeEach(beforeEachFunction);
|
|
||||||
},
|
|
||||||
|
|
||||||
afterEach: function(afterEachFunction) {
|
|
||||||
return env.afterEach(afterEachFunction);
|
|
||||||
},
|
|
||||||
|
|
||||||
expect: function(actual) {
|
|
||||||
return env.expect(actual);
|
|
||||||
},
|
|
||||||
|
|
||||||
pending: function() {
|
|
||||||
return env.pending();
|
|
||||||
},
|
|
||||||
|
|
||||||
spyOn: function(obj, methodName) {
|
|
||||||
return env.spyOn(obj, methodName);
|
|
||||||
},
|
|
||||||
|
|
||||||
jsApiReporter: new jasmine.JsApiReporter({
|
|
||||||
timer: new jasmine.Timer()
|
|
||||||
})
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add all of the Jasmine global/public interface to the proper global, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
|
* Add all of the Jasmine global/public interface to the proper global, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
|
||||||
@@ -105,27 +65,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||||||
extend(window, jasmineInterface);
|
extend(window, jasmineInterface);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Expose the interface for adding custom equality testers.
|
|
||||||
*/
|
|
||||||
jasmine.addCustomEqualityTester = function(tester) {
|
|
||||||
env.addCustomEqualityTester(tester);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Expose the interface for adding custom expectation matchers
|
|
||||||
*/
|
|
||||||
jasmine.addMatchers = function(matchers) {
|
|
||||||
return env.addMatchers(matchers);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Expose the mock interface for the JavaScript timeout functions
|
|
||||||
*/
|
|
||||||
jasmine.clock = function() {
|
|
||||||
return env.clock;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ## Runner Parameters
|
* ## Runner Parameters
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -32,47 +32,7 @@
|
|||||||
*
|
*
|
||||||
* Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged.
|
* Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged.
|
||||||
*/
|
*/
|
||||||
var jasmineInterface = {
|
var jasmineInterface = jasmineRequire.interface(jasmine, env);
|
||||||
describe: function(description, specDefinitions) {
|
|
||||||
return env.describe(description, specDefinitions);
|
|
||||||
},
|
|
||||||
|
|
||||||
xdescribe: function(description, specDefinitions) {
|
|
||||||
return env.xdescribe(description, specDefinitions);
|
|
||||||
},
|
|
||||||
|
|
||||||
it: function(desc, func) {
|
|
||||||
return env.it(desc, func);
|
|
||||||
},
|
|
||||||
|
|
||||||
xit: function(desc, func) {
|
|
||||||
return env.xit(desc, func);
|
|
||||||
},
|
|
||||||
|
|
||||||
beforeEach: function(beforeEachFunction) {
|
|
||||||
return env.beforeEach(beforeEachFunction);
|
|
||||||
},
|
|
||||||
|
|
||||||
afterEach: function(afterEachFunction) {
|
|
||||||
return env.afterEach(afterEachFunction);
|
|
||||||
},
|
|
||||||
|
|
||||||
expect: function(actual) {
|
|
||||||
return env.expect(actual);
|
|
||||||
},
|
|
||||||
|
|
||||||
pending: function() {
|
|
||||||
return env.pending();
|
|
||||||
},
|
|
||||||
|
|
||||||
spyOn: function(obj, methodName) {
|
|
||||||
return env.spyOn(obj, methodName);
|
|
||||||
},
|
|
||||||
|
|
||||||
jsApiReporter: new jasmine.JsApiReporter({
|
|
||||||
timer: new jasmine.Timer()
|
|
||||||
})
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add all of the Jasmine global/public interface to the proper global, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
|
* Add all of the Jasmine global/public interface to the proper global, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
|
||||||
@@ -83,27 +43,6 @@
|
|||||||
extend(window, jasmineInterface);
|
extend(window, jasmineInterface);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Expose the interface for adding custom equality testers.
|
|
||||||
*/
|
|
||||||
jasmine.addCustomEqualityTester = function(tester) {
|
|
||||||
env.addCustomEqualityTester(tester);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Expose the interface for adding custom expectation matchers
|
|
||||||
*/
|
|
||||||
jasmine.addMatchers = function(matchers) {
|
|
||||||
return env.addMatchers(matchers);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Expose the mock interface for the JavaScript timeout functions
|
|
||||||
*/
|
|
||||||
jasmine.clock = function() {
|
|
||||||
return env.clock;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ## Runner Parameters
|
* ## Runner Parameters
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -6,66 +6,14 @@ module.exports = function(jasmineRequire) {
|
|||||||
|
|
||||||
var env = jasmine.getEnv();
|
var env = jasmine.getEnv();
|
||||||
|
|
||||||
var jasmineInterface = {
|
var jasmineInterface = jasmineRequire.interface(jasmine, env);
|
||||||
describe: function(description, specDefinitions) {
|
|
||||||
return env.describe(description, specDefinitions);
|
|
||||||
},
|
|
||||||
|
|
||||||
xdescribe: function(description, specDefinitions) {
|
|
||||||
return env.xdescribe(description, specDefinitions);
|
|
||||||
},
|
|
||||||
|
|
||||||
it: function(desc, func) {
|
|
||||||
return env.it(desc, func);
|
|
||||||
},
|
|
||||||
|
|
||||||
xit: function(desc, func) {
|
|
||||||
return env.xit(desc, func);
|
|
||||||
},
|
|
||||||
|
|
||||||
beforeEach: function(beforeEachFunction) {
|
|
||||||
return env.beforeEach(beforeEachFunction);
|
|
||||||
},
|
|
||||||
|
|
||||||
afterEach: function(afterEachFunction) {
|
|
||||||
return env.afterEach(afterEachFunction);
|
|
||||||
},
|
|
||||||
|
|
||||||
expect: function(actual) {
|
|
||||||
return env.expect(actual);
|
|
||||||
},
|
|
||||||
|
|
||||||
spyOn: function(obj, methodName) {
|
|
||||||
return env.spyOn(obj, methodName);
|
|
||||||
},
|
|
||||||
|
|
||||||
jsApiReporter: new jasmine.JsApiReporter({
|
|
||||||
timer: new jasmine.Timer()
|
|
||||||
}),
|
|
||||||
|
|
||||||
|
|
||||||
jasmine: jasmine
|
|
||||||
};
|
|
||||||
|
|
||||||
extend(global, jasmineInterface);
|
extend(global, jasmineInterface);
|
||||||
|
|
||||||
jasmine.addCustomEqualityTester = function(tester) {
|
|
||||||
env.addCustomEqualityTester(tester);
|
|
||||||
};
|
|
||||||
|
|
||||||
jasmine.addMatchers = function(matchers) {
|
|
||||||
return env.addMatchers(matchers);
|
|
||||||
};
|
|
||||||
|
|
||||||
jasmine.clock = function() {
|
|
||||||
return env.clock;
|
|
||||||
};
|
|
||||||
|
|
||||||
function extend(destination, source) {
|
function extend(destination, source) {
|
||||||
for (var property in source) destination[property] = source[property];
|
for (var property in source) destination[property] = source[property];
|
||||||
return destination;
|
return destination;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return jasmine;
|
return jasmine;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ body { overflow-y: scroll; }
|
|||||||
.jasmine_html-reporter .symbol-summary li.disabled:before { color: #bababa; content: "\02022"; }
|
.jasmine_html-reporter .symbol-summary li.disabled:before { color: #bababa; content: "\02022"; }
|
||||||
.jasmine_html-reporter .symbol-summary li.pending { line-height: 17px; }
|
.jasmine_html-reporter .symbol-summary li.pending { line-height: 17px; }
|
||||||
.jasmine_html-reporter .symbol-summary li.pending:before { color: #ba9d37; content: "*"; }
|
.jasmine_html-reporter .symbol-summary li.pending:before { color: #ba9d37; content: "*"; }
|
||||||
|
.jasmine_html-reporter .symbol-summary li.empty { font-size: 14px; }
|
||||||
|
.jasmine_html-reporter .symbol-summary li.empty:before { color: #ba9d37; content: "\02022"; }
|
||||||
.jasmine_html-reporter .exceptions { color: #fff; float: right; margin-top: 5px; margin-right: 5px; }
|
.jasmine_html-reporter .exceptions { color: #fff; float: right; margin-top: 5px; margin-right: 5px; }
|
||||||
.jasmine_html-reporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; }
|
.jasmine_html-reporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; }
|
||||||
.jasmine_html-reporter .bar.failed { background-color: #ca3a11; }
|
.jasmine_html-reporter .bar.failed { background-color: #ca3a11; }
|
||||||
|
|||||||
@@ -1352,11 +1352,26 @@ getJasmineRequireObj().MockDate = function() {
|
|||||||
return self;
|
return self;
|
||||||
|
|
||||||
function FakeDate() {
|
function FakeDate() {
|
||||||
if (arguments.length === 0) {
|
switch(arguments.length) {
|
||||||
return new GlobalDate(currentTime);
|
case 0:
|
||||||
} else {
|
return new GlobalDate(currentTime);
|
||||||
return new GlobalDate(arguments[0], arguments[1], arguments[2],
|
case 1:
|
||||||
arguments[3], arguments[4], arguments[5], arguments[6]);
|
return new GlobalDate(arguments[0]);
|
||||||
|
case 2:
|
||||||
|
return new GlobalDate(arguments[0], arguments[1]);
|
||||||
|
case 3:
|
||||||
|
return new GlobalDate(arguments[0], arguments[1], arguments[2]);
|
||||||
|
case 4:
|
||||||
|
return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3]);
|
||||||
|
case 5:
|
||||||
|
return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3],
|
||||||
|
arguments[4]);
|
||||||
|
case 6:
|
||||||
|
return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3],
|
||||||
|
arguments[4], arguments[5]);
|
||||||
|
case 7:
|
||||||
|
return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3],
|
||||||
|
arguments[4], arguments[5], arguments[6]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1771,6 +1786,7 @@ getJasmineRequireObj().Suite = function() {
|
|||||||
|
|
||||||
Suite.prototype.disable = function() {
|
Suite.prototype.disable = function() {
|
||||||
this.disabled = true;
|
this.disabled = true;
|
||||||
|
this.result.status = 'disabled';
|
||||||
};
|
};
|
||||||
|
|
||||||
Suite.prototype.beforeEach = function(fn) {
|
Suite.prototype.beforeEach = function(fn) {
|
||||||
@@ -1787,6 +1803,9 @@ getJasmineRequireObj().Suite = function() {
|
|||||||
|
|
||||||
Suite.prototype.execute = function(onComplete) {
|
Suite.prototype.execute = function(onComplete) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
this.onStart(this);
|
||||||
|
|
||||||
if (this.disabled) {
|
if (this.disabled) {
|
||||||
complete();
|
complete();
|
||||||
return;
|
return;
|
||||||
@@ -1798,8 +1817,6 @@ getJasmineRequireObj().Suite = function() {
|
|||||||
allFns.push(wrapChildAsAsync(this.children[i]));
|
allFns.push(wrapChildAsAsync(this.children[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.onStart(this);
|
|
||||||
|
|
||||||
this.queueRunner({
|
this.queueRunner({
|
||||||
fns: allFns,
|
fns: allFns,
|
||||||
onComplete: complete
|
onComplete: complete
|
||||||
@@ -2511,6 +2528,66 @@ getJasmineRequireObj().toThrowError = function(j$) {
|
|||||||
return toThrowError;
|
return toThrowError;
|
||||||
};
|
};
|
||||||
|
|
||||||
getJasmineRequireObj().version = function() {
|
getJasmineRequireObj().interface = function(jasmine, env) {
|
||||||
return '2.0.1';
|
var jasmineInterface = {
|
||||||
|
describe: function(description, specDefinitions) {
|
||||||
|
return env.describe(description, specDefinitions);
|
||||||
|
},
|
||||||
|
|
||||||
|
xdescribe: function(description, specDefinitions) {
|
||||||
|
return env.xdescribe(description, specDefinitions);
|
||||||
|
},
|
||||||
|
|
||||||
|
it: function(desc, func) {
|
||||||
|
return env.it(desc, func);
|
||||||
|
},
|
||||||
|
|
||||||
|
xit: function(desc, func) {
|
||||||
|
return env.xit(desc, func);
|
||||||
|
},
|
||||||
|
|
||||||
|
beforeEach: function(beforeEachFunction) {
|
||||||
|
return env.beforeEach(beforeEachFunction);
|
||||||
|
},
|
||||||
|
|
||||||
|
afterEach: function(afterEachFunction) {
|
||||||
|
return env.afterEach(afterEachFunction);
|
||||||
|
},
|
||||||
|
|
||||||
|
expect: function(actual) {
|
||||||
|
return env.expect(actual);
|
||||||
|
},
|
||||||
|
|
||||||
|
pending: function() {
|
||||||
|
return env.pending();
|
||||||
|
},
|
||||||
|
|
||||||
|
spyOn: function(obj, methodName) {
|
||||||
|
return env.spyOn(obj, methodName);
|
||||||
|
},
|
||||||
|
|
||||||
|
jsApiReporter: new jasmine.JsApiReporter({
|
||||||
|
timer: new jasmine.Timer()
|
||||||
|
}),
|
||||||
|
|
||||||
|
jasmine: jasmine
|
||||||
|
};
|
||||||
|
|
||||||
|
jasmine.addCustomEqualityTester = function(tester) {
|
||||||
|
env.addCustomEqualityTester(tester);
|
||||||
|
};
|
||||||
|
|
||||||
|
jasmine.addMatchers = function(matchers) {
|
||||||
|
return env.addMatchers(matchers);
|
||||||
|
};
|
||||||
|
|
||||||
|
jasmine.clock = function() {
|
||||||
|
return env.clock;
|
||||||
|
};
|
||||||
|
|
||||||
|
return jasmineInterface;
|
||||||
|
};
|
||||||
|
|
||||||
|
getJasmineRequireObj().version = function() {
|
||||||
|
return '2.0.2';
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -28,66 +28,14 @@ module.exports = function(jasmineRequire) {
|
|||||||
|
|
||||||
var env = jasmine.getEnv();
|
var env = jasmine.getEnv();
|
||||||
|
|
||||||
var jasmineInterface = {
|
var jasmineInterface = jasmineRequire.interface(jasmine, env);
|
||||||
describe: function(description, specDefinitions) {
|
|
||||||
return env.describe(description, specDefinitions);
|
|
||||||
},
|
|
||||||
|
|
||||||
xdescribe: function(description, specDefinitions) {
|
|
||||||
return env.xdescribe(description, specDefinitions);
|
|
||||||
},
|
|
||||||
|
|
||||||
it: function(desc, func) {
|
|
||||||
return env.it(desc, func);
|
|
||||||
},
|
|
||||||
|
|
||||||
xit: function(desc, func) {
|
|
||||||
return env.xit(desc, func);
|
|
||||||
},
|
|
||||||
|
|
||||||
beforeEach: function(beforeEachFunction) {
|
|
||||||
return env.beforeEach(beforeEachFunction);
|
|
||||||
},
|
|
||||||
|
|
||||||
afterEach: function(afterEachFunction) {
|
|
||||||
return env.afterEach(afterEachFunction);
|
|
||||||
},
|
|
||||||
|
|
||||||
expect: function(actual) {
|
|
||||||
return env.expect(actual);
|
|
||||||
},
|
|
||||||
|
|
||||||
spyOn: function(obj, methodName) {
|
|
||||||
return env.spyOn(obj, methodName);
|
|
||||||
},
|
|
||||||
|
|
||||||
jsApiReporter: new jasmine.JsApiReporter({
|
|
||||||
timer: new jasmine.Timer()
|
|
||||||
}),
|
|
||||||
|
|
||||||
|
|
||||||
jasmine: jasmine
|
|
||||||
};
|
|
||||||
|
|
||||||
extend(global, jasmineInterface);
|
extend(global, jasmineInterface);
|
||||||
|
|
||||||
jasmine.addCustomEqualityTester = function(tester) {
|
|
||||||
env.addCustomEqualityTester(tester);
|
|
||||||
};
|
|
||||||
|
|
||||||
jasmine.addMatchers = function(matchers) {
|
|
||||||
return env.addMatchers(matchers);
|
|
||||||
};
|
|
||||||
|
|
||||||
jasmine.clock = function() {
|
|
||||||
return env.clock;
|
|
||||||
};
|
|
||||||
|
|
||||||
function extend(destination, source) {
|
function extend(destination, source) {
|
||||||
for (var property in source) destination[property] = source[property];
|
for (var property in source) destination[property] = source[property];
|
||||||
return destination;
|
return destination;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return jasmine;
|
return jasmine;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,6 +4,6 @@
|
|||||||
#
|
#
|
||||||
module Jasmine
|
module Jasmine
|
||||||
module Core
|
module Core
|
||||||
VERSION = "2.0.1"
|
VERSION = "2.0.2"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jasmine-core",
|
"name": "jasmine-core",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "2.0.1",
|
"version": "2.0.2",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/pivotal/jasmine.git"
|
"url": "https://github.com/pivotal/jasmine.git"
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ to determine that there a spec is 'empty'
|
|||||||
* [Add package.json to Python egg to get correct version number](http://www.pivotaltracker.com/story/67556148) - Fixes #551
|
* [Add package.json to Python egg to get correct version number](http://www.pivotaltracker.com/story/67556148) - Fixes #551
|
||||||
* Allow users to set the maximum length of array that the pretty-printer
|
* Allow users to set the maximum length of array that the pretty-printer
|
||||||
will print out - Fixes #323 @mikemoraned and #374 @futuraprime
|
will print out - Fixes #323 @mikemoraned and #374 @futuraprime
|
||||||
* `matchersUtil.equals()`` does not expect a matcher as its first argument,
|
* `matchersUtil.equals()` does not expect a matcher as its first argument,
|
||||||
so send the "actual" value first and the "expected" value second. - Merges #538 from @cbandy
|
so send the "actual" value first and the "expected" value second. - Merges #538 from @cbandy
|
||||||
* Add single quote check to `jshint` and fix src files for that - Closes #522
|
* Add single quote check to `jshint` and fix src files for that - Closes #522
|
||||||
* Remove an `eval` in order to support running jasmine within CSP - Closes #503
|
* Remove an `eval` in order to support running jasmine within CSP - Closes #503
|
||||||
|
|||||||
25
release_notes/2.0.2.md
Normal file
25
release_notes/2.0.2.md
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# Release Notes
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
* keep the files for running in a webpage around in the npm package
|
||||||
|
* Expose files and paths necessary to embed jasmine in an html page for nodejs
|
||||||
|
* Pull out the building of the jasmine interface so node and web both get the same one.
|
||||||
|
* Show a dot with color of pending spec when no expectations
|
||||||
|
* Console reporter prints out failed expectation's message
|
||||||
|
|
||||||
|
### Bugs
|
||||||
|
|
||||||
|
* Allow mocked Date constructor to be called with a subset of full params
|
||||||
|
|
||||||
|
## Pull Requests and Issues
|
||||||
|
|
||||||
|
* a disabled suite should call resultCallback with status being disabled
|
||||||
|
* disabled suite should still call onStart callback
|
||||||
|
|
||||||
|
|
||||||
|
------
|
||||||
|
|
||||||
|
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
||||||
@@ -173,6 +173,7 @@ describe("ConsoleReporter", function() {
|
|||||||
|
|
||||||
reporter.jasmineDone({});
|
reporter.jasmineDone({});
|
||||||
|
|
||||||
|
expect(out.getOutput()).toMatch(/true to be false/);
|
||||||
expect(out.getOutput()).toMatch(/foo bar baz/);
|
expect(out.getOutput()).toMatch(/foo bar baz/);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -157,15 +157,35 @@ describe("FakeDate", function() {
|
|||||||
expect(fakeGlobal.Date.now()).toEqual(1000);
|
expect(fakeGlobal.Date.now()).toEqual(1000);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("allows to create a Date in a different time than the mocked time", function() {
|
it("allows creation of a Date in a different time than the mocked time", function() {
|
||||||
var fakeGlobal = { Date: Date },
|
var fakeGlobal = { Date: Date },
|
||||||
mockDate = new j$.MockDate(fakeGlobal),
|
mockDate = new j$.MockDate(fakeGlobal);
|
||||||
baseDate = new Date(2013, 9, 23, 0, 0, 0, 0);
|
|
||||||
|
|
||||||
mockDate.install(baseDate);
|
mockDate.install();
|
||||||
|
|
||||||
var otherDate = new fakeGlobal.Date(2013, 9, 23, 0, 0, 1, 0);
|
var otherDate = new fakeGlobal.Date(2013, 9, 23, 0, 0, 1, 0);
|
||||||
expect(otherDate.getTime()).not.toEqual(baseDate.getTime());
|
expect(otherDate.getTime()).toEqual(new Date(2013, 9, 23, 0, 0, 1, 0).getTime());
|
||||||
|
});
|
||||||
|
|
||||||
|
it("allows creation of a Date that isn't fully specified", function() {
|
||||||
|
var fakeGlobal = { Date: Date },
|
||||||
|
mockDate = new j$.MockDate(fakeGlobal);
|
||||||
|
|
||||||
|
mockDate.install();
|
||||||
|
|
||||||
|
var otherDate = new fakeGlobal.Date(2013, 9, 23);
|
||||||
|
expect(otherDate.getTime()).toEqual(new Date(2013, 9, 23).getTime());
|
||||||
|
});
|
||||||
|
|
||||||
|
it('allows creation of a Date with millis', function() {
|
||||||
|
var fakeGlobal = { Date: Date },
|
||||||
|
mockDate = new j$.MockDate(fakeGlobal),
|
||||||
|
now = new Date(2014, 3, 15).getTime();
|
||||||
|
|
||||||
|
mockDate.install();
|
||||||
|
|
||||||
|
var otherDate = new fakeGlobal.Date(now);
|
||||||
|
expect(otherDate.getTime()).toEqual(now);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("copies all Date properties to the mocked date", function() {
|
it("copies all Date properties to the mocked date", function() {
|
||||||
|
|||||||
@@ -67,12 +67,17 @@ describe("Suite", function() {
|
|||||||
expect(suite.afterFns).toEqual([innerAfter, outerAfter]);
|
expect(suite.afterFns).toEqual([innerAfter, outerAfter]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("can be disabled", function() {
|
it("can be disabled, but still calls callbacks", function() {
|
||||||
var env = new j$.Env(),
|
var env = new j$.Env(),
|
||||||
fakeQueueRunner = jasmine.createSpy('fake queue runner'),
|
fakeQueueRunner = jasmine.createSpy('fake queue runner'),
|
||||||
|
onStart = jasmine.createSpy('onStart'),
|
||||||
|
resultCallback = jasmine.createSpy('resultCallback'),
|
||||||
|
onComplete = jasmine.createSpy('onComplete'),
|
||||||
suite = new j$.Suite({
|
suite = new j$.Suite({
|
||||||
env: env,
|
env: env,
|
||||||
description: "with a child suite",
|
description: "with a child suite",
|
||||||
|
onStart: onStart,
|
||||||
|
resultCallback: resultCallback,
|
||||||
queueRunner: fakeQueueRunner
|
queueRunner: fakeQueueRunner
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -80,9 +85,12 @@ describe("Suite", function() {
|
|||||||
|
|
||||||
expect(suite.disabled).toBe(true);
|
expect(suite.disabled).toBe(true);
|
||||||
|
|
||||||
suite.execute();
|
suite.execute(onComplete);
|
||||||
|
|
||||||
expect(fakeQueueRunner).not.toHaveBeenCalled();
|
expect(fakeQueueRunner).not.toHaveBeenCalled();
|
||||||
|
expect(onStart).toHaveBeenCalled();
|
||||||
|
expect(resultCallback).toHaveBeenCalled();
|
||||||
|
expect(onComplete).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("delegates execution of its specs and suites", function() {
|
it("delegates execution of its specs and suites", function() {
|
||||||
@@ -179,4 +187,30 @@ describe("Suite", function() {
|
|||||||
fullName: "with a child suite"
|
fullName: "with a child suite"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("calls a provided result callback with status being disabled when disabled and done", function() {
|
||||||
|
var env = new j$.Env(),
|
||||||
|
suiteResultsCallback = jasmine.createSpy('suite result callback'),
|
||||||
|
fakeQueueRunner = function(attrs) { attrs.onComplete(); },
|
||||||
|
suite = new j$.Suite({
|
||||||
|
env: env,
|
||||||
|
description: "with a child suite",
|
||||||
|
queueRunner: fakeQueueRunner,
|
||||||
|
resultCallback: suiteResultsCallback
|
||||||
|
}),
|
||||||
|
fakeSpec1 = {
|
||||||
|
execute: jasmine.createSpy('fakeSpec1')
|
||||||
|
};
|
||||||
|
|
||||||
|
suite.disable();
|
||||||
|
|
||||||
|
suite.execute();
|
||||||
|
|
||||||
|
expect(suiteResultsCallback).toHaveBeenCalledWith({
|
||||||
|
id: suite.id,
|
||||||
|
status: 'disabled',
|
||||||
|
description: "with a child suite",
|
||||||
|
fullName: "with a child suite"
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ getJasmineRequireObj().ConsoleReporter = function() {
|
|||||||
for (var i = 0; i < result.failedExpectations.length; i++) {
|
for (var i = 0; i < result.failedExpectations.length; i++) {
|
||||||
var failedExpectation = result.failedExpectations[i];
|
var failedExpectation = result.failedExpectations[i];
|
||||||
printNewline();
|
printNewline();
|
||||||
|
print(indent(failedExpectation.message, 2));
|
||||||
print(indent(failedExpectation.stack, 2));
|
print(indent(failedExpectation.stack, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,11 +37,26 @@ getJasmineRequireObj().MockDate = function() {
|
|||||||
return self;
|
return self;
|
||||||
|
|
||||||
function FakeDate() {
|
function FakeDate() {
|
||||||
if (arguments.length === 0) {
|
switch(arguments.length) {
|
||||||
return new GlobalDate(currentTime);
|
case 0:
|
||||||
} else {
|
return new GlobalDate(currentTime);
|
||||||
return new GlobalDate(arguments[0], arguments[1], arguments[2],
|
case 1:
|
||||||
arguments[3], arguments[4], arguments[5], arguments[6]);
|
return new GlobalDate(arguments[0]);
|
||||||
|
case 2:
|
||||||
|
return new GlobalDate(arguments[0], arguments[1]);
|
||||||
|
case 3:
|
||||||
|
return new GlobalDate(arguments[0], arguments[1], arguments[2]);
|
||||||
|
case 4:
|
||||||
|
return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3]);
|
||||||
|
case 5:
|
||||||
|
return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3],
|
||||||
|
arguments[4]);
|
||||||
|
case 6:
|
||||||
|
return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3],
|
||||||
|
arguments[4], arguments[5]);
|
||||||
|
case 7:
|
||||||
|
return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3],
|
||||||
|
arguments[4], arguments[5], arguments[6]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ getJasmineRequireObj().Suite = function() {
|
|||||||
|
|
||||||
Suite.prototype.disable = function() {
|
Suite.prototype.disable = function() {
|
||||||
this.disabled = true;
|
this.disabled = true;
|
||||||
|
this.result.status = 'disabled';
|
||||||
};
|
};
|
||||||
|
|
||||||
Suite.prototype.beforeEach = function(fn) {
|
Suite.prototype.beforeEach = function(fn) {
|
||||||
@@ -51,6 +52,9 @@ getJasmineRequireObj().Suite = function() {
|
|||||||
|
|
||||||
Suite.prototype.execute = function(onComplete) {
|
Suite.prototype.execute = function(onComplete) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
this.onStart(this);
|
||||||
|
|
||||||
if (this.disabled) {
|
if (this.disabled) {
|
||||||
complete();
|
complete();
|
||||||
return;
|
return;
|
||||||
@@ -62,8 +66,6 @@ getJasmineRequireObj().Suite = function() {
|
|||||||
allFns.push(wrapChildAsAsync(this.children[i]));
|
allFns.push(wrapChildAsAsync(this.children[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.onStart(this);
|
|
||||||
|
|
||||||
this.queueRunner({
|
this.queueRunner({
|
||||||
fns: allFns,
|
fns: allFns,
|
||||||
onComplete: complete
|
onComplete: complete
|
||||||
|
|||||||
59
src/core/requireInterface.js
Normal file
59
src/core/requireInterface.js
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
getJasmineRequireObj().interface = function(jasmine, env) {
|
||||||
|
var jasmineInterface = {
|
||||||
|
describe: function(description, specDefinitions) {
|
||||||
|
return env.describe(description, specDefinitions);
|
||||||
|
},
|
||||||
|
|
||||||
|
xdescribe: function(description, specDefinitions) {
|
||||||
|
return env.xdescribe(description, specDefinitions);
|
||||||
|
},
|
||||||
|
|
||||||
|
it: function(desc, func) {
|
||||||
|
return env.it(desc, func);
|
||||||
|
},
|
||||||
|
|
||||||
|
xit: function(desc, func) {
|
||||||
|
return env.xit(desc, func);
|
||||||
|
},
|
||||||
|
|
||||||
|
beforeEach: function(beforeEachFunction) {
|
||||||
|
return env.beforeEach(beforeEachFunction);
|
||||||
|
},
|
||||||
|
|
||||||
|
afterEach: function(afterEachFunction) {
|
||||||
|
return env.afterEach(afterEachFunction);
|
||||||
|
},
|
||||||
|
|
||||||
|
expect: function(actual) {
|
||||||
|
return env.expect(actual);
|
||||||
|
},
|
||||||
|
|
||||||
|
pending: function() {
|
||||||
|
return env.pending();
|
||||||
|
},
|
||||||
|
|
||||||
|
spyOn: function(obj, methodName) {
|
||||||
|
return env.spyOn(obj, methodName);
|
||||||
|
},
|
||||||
|
|
||||||
|
jsApiReporter: new jasmine.JsApiReporter({
|
||||||
|
timer: new jasmine.Timer()
|
||||||
|
}),
|
||||||
|
|
||||||
|
jasmine: jasmine
|
||||||
|
};
|
||||||
|
|
||||||
|
jasmine.addCustomEqualityTester = function(tester) {
|
||||||
|
env.addCustomEqualityTester(tester);
|
||||||
|
};
|
||||||
|
|
||||||
|
jasmine.addMatchers = function(matchers) {
|
||||||
|
return env.addMatchers(matchers);
|
||||||
|
};
|
||||||
|
|
||||||
|
jasmine.clock = function() {
|
||||||
|
return env.clock;
|
||||||
|
};
|
||||||
|
|
||||||
|
return jasmineInterface;
|
||||||
|
};
|
||||||
@@ -154,6 +154,15 @@ body {
|
|||||||
content: "*";
|
content: "*";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.empty {
|
||||||
|
font-size: 14px;
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
color: $pending-color;
|
||||||
|
content: "\02022";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user