Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: mhevery/jasmine-node
base: master@{1394020686}
...
head fork: mhevery/jasmine-node
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
  • 19 commits
  • 7 files changed
  • 1 commit comment
  • 6 contributors
Commits on Feb 03, 2014
@mgcrea mgcrea chore(jasmine): use karma's jasmine
f84f851
Commits on Mar 05, 2014
@tebriel tebriel Update README.md
c28b4db
Commits on Mar 06, 2014
Chris Moultrie Preparing for release
5598ca8
Chris Moultrie Merge branch 'master' of github.com:mhevery/jasmine-node
60296f9
Chris Moultrie Disabling color in non-TTY
Resolves #253
4deb23c
Commits on Mar 07, 2014
Chris Moultrie Uhmm. npm publish --tag beta somehow published to latest. Not a fan.
ae0bb69
Commits on Mar 10, 2014
Chris Moultrie more changes
edfb1bc
Chris Moultrie MOre changes
00ff943
Commits on Mar 23, 2014
@JoergFiedler JoergFiedler fixed: TeamcityReporter does not support "onComplete" callback which …
…is used by grunt-jasmine-node to determine the exit code
9800757
Commits on Mar 26, 2014
@qstrahl qstrahl Fix "comtaining" typo in README.md
acae564
Commits on Mar 29, 2014
@tebriel tebriel Merge pull request #304 from qstrahl/master
Fix "comtaining" typo in README.md
7eedace
@tebriel tebriel Merge pull request #303 from JoergFiedler/added_onComplete_callback_t…
…o_teamcityreporter

Added 'onComplete' callback to TeamCityReporter
67555e8
Chris Moultrie Merge branch 'master' of github.com:mhevery/jasmine-node
df7461a
Chris Moultrie Updating version for publish
1224bd0
Commits on Jul 09, 2014
@tjmcduffie tjmcduffie updated dependency settings for jasmine reporters to require 0.4.1
02748c8
Commits on Jul 15, 2014
@tjmcduffie tjmcduffie updated reporters package to v1.0.0
340639c
Commits on Jul 16, 2014
@tebriel tebriel Merge pull request #339 from tjmcduffie/master
Downgrade Jasmine Reporters to v1.0.0
7545d75
@tebriel tebriel Prepping for publish
ab087e6
@tebriel tebriel Fixing ^ vs ~ issue
6c6099b
View
5 .travis.yml
@@ -1,6 +1,3 @@
language: node_js
node_js:
- - 0.6
-branches:
- only:
- - travis
+ - "0.10"
View
21 README.md
@@ -3,14 +3,17 @@ jasmine-node
[![Build Status](https://secure.travis-ci.org/spaghetticode/jasmine-node.png)](http://travis-ci.org/spaghetticode/jasmine-node)
-This node.js module makes the wonderful Pivotal Lab's jasmine
-(http://github.com/pivotal/jasmine) spec framework available in
-node.js.
+This node.js module makes the wonderful [Pivotal Lab's jasmine](http://github.com/pivotal/jasmine)
+spec framework available in node.js.
jasmine
-------
-Version `1.3.1` of Jasmine is currently included with node-jasmine.
+Version `1.3.1` of Jasmine is currently included with node-jasmine. This is a forked version from the
+[Karma project](https://github.com/karma-runner/karma-jasmine), which allows you to use the
+`ddescribe` and `iit` functions to run individual suites or specs.
+
+BETA `2.0.0` Support is available in the `Jasmine2.0` branch.
what's new
----------
@@ -47,7 +50,7 @@ usage
------
Write the specifications for your code in `*.js` and `*.coffee` files in the `spec/` directory.
-You can use sub-directories to better organise your specs. In the specs use `describe()`, `it()` etc. exactly
+You can use sub-directories to better organise your specs. In the specs use `describe()`, `it()` etc. exactly
as you would in client-side jasmine specs.
**Note**: your specification files must be named as `*spec.js`, `*spec.coffee` or `*spec.litcoffee`,
@@ -78,7 +81,7 @@ watched for changes, allowing to watch for changes outside of specs directory
* `--color`, indicates spec output should uses color to
indicates passing (green) or failing (red) specs
* `--noColor`, do not use color in the output
- * `-m, --match REGEXP`, match only specs comtaining "REGEXPspec"
+ * `-m, --match REGEXP`, match only specs containing "REGEXPspec"
* `--matchall`, relax requirement of "spec" in spec file names
* `--verbose`, verbose output as the specs are run
* `--junitreport`, export tests results as junitreport xml format
@@ -235,6 +238,12 @@ to update this with your PR.
changelog
---------
+* _1.14.5_ Using ~ instead of ^ for reporter version (thanks to [Maxim-Filimonov](https://github.com/Maxim-Filimonov))
+* _1.14.4_ Rolled back jasmine reporter version (thanks to [tjmcduffie](https://github.com/tjmcduffie))
+* _1.14.3_ Added 'onComplete' callback to TeamCityReporter (thanks to [JoergFiedler](https://github.com/JoergFiedler))
+* _1.14.2_ Uhhh...not sure what happened here.
+* _1.14.1_ Default to noColors if not in a TTY
+* _1.14.0_ Add support for `iit`, `ddescribe` (thanks to [mgcrea](https://github.com/mgcrea))
* _1.13.1_ Add coffee-script support for 1.7.x (thanks to [nathancarter](https://github.com/nathancarter))
* _1.13.0_ Added timing to the verbose reporter (thanks to [rick-kilgore](https://github.com/rick-kilgore))
* _1.12.1_ Fixed an issue where an undefined variable caused an unhelpful
View
6 lib/jasmine-node/cli.js
@@ -24,6 +24,10 @@ for (var key in jasmine)
var isVerbose = false;
var showColors = true;
+// Disable if we're not on a TTY
+if (!process.stdout.isTTY) {
+ showColors = false;
+}
var teamcity = process.env.TEAMCITY_PROJECT_NAME || false;
var useRequireJs = false;
var extensions = "js";
@@ -278,6 +282,6 @@ function help(){
}
function printVersion(){
- console.log("1.13.1");
+ console.log("1.14.3");
process.exit(0);
}
View
3  lib/jasmine-node/index.js
@@ -34,6 +34,7 @@ require("jasmine-reporters");
var nodeReporters = require('./reporter').jasmineNode;
jasmine.TerminalVerboseReporter = nodeReporters.TerminalVerboseReporter;
jasmine.TerminalReporter = nodeReporters.TerminalReporter;
+jasmine.TeamcityReporter = nodeReporters.TeamcityReporter;
jasmine.GrowlReporter = require('jasmine-growl-reporter');
@@ -123,7 +124,7 @@ jasmine.executeSpecsInFolder = function(options){
}
if(teamcity){
- jasmineEnv.addReporter(new jasmine.TeamcityReporter());
+ jasmineEnv.addReporter(new jasmine.TeamcityReporter({onComplete: done}));
} else if(isVerbose) {
jasmineEnv.addReporter(new jasmine.TerminalVerboseReporter({ print: print,
color: showColors,
View
107 lib/jasmine-node/jasmine-1.3.1.js
@@ -305,7 +305,7 @@ jasmine.Spy = function(name) {
};
/**
- * Tells a spy to call through to the actual implemenatation.
+ * Tells a spy to call through to the actual implementation.
*
* @example
* var foo = {
@@ -501,6 +501,32 @@ var it = function(desc, func) {
if (isCommonJS) exports.it = it;
/**
+ * Creates an exclusive Jasmine spec that will be added to the current suite.
+ *
+ * If at least one exclusive (iit) spec is registered, only these exclusive specs are run.
+ * Note, that this behavior works only with the default specFilter.
+ * Note, that iit has higher priority over ddescribe
+ *
+ * @example
+ * describe('suite', function() {
+ * iit('should be true', function() {
+ * // only this spec will be run
+ * });
+ *
+ * it('should be false', function() {
+ * // this won't be run
+ * });
+ * });
+ *
+ * @param {String} desc description of this specification
+ * @param {Function} func defines the preconditions and expectations of the spec
+ */
+var iit = function(desc, func) {
+ return jasmine.getEnv().iit(desc, func);
+};
+if (isCommonJS) exports.iit = iit;
+
+/**
* Creates a <em>disabled</em> Jasmine spec.
*
* A convenience method that allows existing specs to be disabled temporarily during development.
@@ -604,6 +630,37 @@ var describe = function(description, specDefinitions) {
};
if (isCommonJS) exports.describe = describe;
+
+/**
+ * Defines an exclusive suite of specifications.
+ *
+ * If at least one exclusive (ddescribe) suite is registered, only these exclusive suites are run.
+ * Note, that this behavior works only with the default specFilter.
+ *
+ * @example
+ * ddescribe('exclusive suite', function() {
+ * it('should be true', function() {
+ * // this spec will be run
+ * });
+ *
+ * it('should be false', function() {
+ * // this spec will be run as well
+ * });
+ * });
+ *
+ * describe('normal suite', function() {
+ * // no spec from this suite will be run
+ * });
+ *
+ *
+ * @param {String} description A string, usually the class under test.
+ * @param {Function} specDefinitions function that defines several specs.
+ */
+var ddescribe = function(description, specDefinitions) {
+ return jasmine.getEnv().ddescribe(description, specDefinitions);
+};
+if (isCommonJS) exports.ddescribe = ddescribe;
+
/**
* Disables a suite of specifications. Used to disable some suites in a file, or files, temporarily during development.
*
@@ -725,14 +782,19 @@ jasmine.Env = function() {
this.updateInterval = jasmine.DEFAULT_UPDATE_INTERVAL;
this.defaultTimeoutInterval = jasmine.DEFAULT_TIMEOUT_INTERVAL;
this.lastUpdate = 0;
- this.specFilter = function() {
- return true;
+ this.specFilter = function(spec) {
+ return this.exclusive_ <= spec.exclusive_;
};
this.nextSpecId_ = 0;
this.nextSuiteId_ = 0;
this.equalityTesters_ = [];
+ // 0 - normal
+ // 1 - contains some ddescribe
+ // 2 - contains some iit
+ this.exclusive_ = 0;
+
// wrap matchers
this.matchersClass = function() {
jasmine.Matchers.apply(this, arguments);
@@ -803,8 +865,11 @@ jasmine.Env.prototype.execute = function() {
};
jasmine.Env.prototype.describe = function(description, specDefinitions) {
- var suite = new jasmine.Suite(this, description, specDefinitions, this.currentSuite);
+ var suite = new jasmine.Suite(this, description, null, this.currentSuite);
+ return this.describe_(suite, specDefinitions);
+};
+jasmine.Env.prototype.describe_ = function(suite, specDefinitions) {
var parentSuite = this.currentSuite;
if (parentSuite) {
parentSuite.add(suite);
@@ -832,6 +897,14 @@ jasmine.Env.prototype.describe = function(description, specDefinitions) {
return suite;
};
+jasmine.Env.prototype.ddescribe = function(description, specDefinitions) {
+ var suite = new jasmine.Suite(this, description, null, this.currentSuite);
+ suite.exclusive_ = 1;
+ this.exclusive_ = Math.max(this.exclusive_, 1);
+
+ return this.describe_(suite, specDefinitions);
+};
+
jasmine.Env.prototype.beforeEach = function(beforeEachFunction) {
if (this.currentSuite) {
this.currentSuite.beforeEach(beforeEachFunction);
@@ -872,6 +945,14 @@ jasmine.Env.prototype.it = function(description, func) {
return spec;
};
+jasmine.Env.prototype.iit = function(description, func) {
+ var spec = this.it(description, func);
+ spec.exclusive_ = 2;
+ this.exclusive_ = 2;
+
+ return spec;
+};
+
jasmine.Env.prototype.xit = function(desc, func) {
return {
id: this.nextSpecId(),
@@ -1100,7 +1181,7 @@ jasmine.JsApiReporter.prototype.summarize_ = function(suiteOrSpec) {
type: isSuite ? 'suite' : 'spec',
children: []
};
-
+
if (isSuite) {
var children = suiteOrSpec.children();
for (var i = 0; i < children.length; i++) {
@@ -1326,11 +1407,11 @@ jasmine.Matchers.prototype.toBeNull = function() {
* Matcher that compares the actual to NaN.
*/
jasmine.Matchers.prototype.toBeNaN = function() {
- this.message = function() {
- return [ "Expected " + jasmine.pp(this.actual) + " to be NaN." ];
- };
+ this.message = function() {
+ return [ "Expected " + jasmine.pp(this.actual) + " to be NaN." ];
+ };
- return (this.actual !== this.actual);
+ return (this.actual !== this.actual);
};
/**
@@ -1929,7 +2010,7 @@ jasmine.PrettyPrinter.prototype.iterateObject = function(obj, fn) {
for (var property in obj) {
if (!obj.hasOwnProperty(property)) continue;
if (property == '__Jasmine_been_here_before__') continue;
- fn(property, obj.__lookupGetter__ ? (obj.__lookupGetter__(property) !== jasmine.undefined &&
+ fn(property, obj.__lookupGetter__ ? (obj.__lookupGetter__(property) !== jasmine.undefined &&
obj.__lookupGetter__(property) !== null) : false);
}
};
@@ -2061,7 +2142,7 @@ jasmine.Queue.prototype.next_ = function() {
while (goAgain) {
goAgain = false;
-
+
if (self.index < self.blocks.length && !(this.abort && !this.ensured[self.index])) {
var calledSynchronously = true;
var completedSynchronously = false;
@@ -2099,7 +2180,7 @@ jasmine.Queue.prototype.next_ = function() {
if (completedSynchronously) {
onComplete();
}
-
+
} else {
self.running = false;
if (self.onComplete) {
@@ -2225,6 +2306,7 @@ jasmine.Spec = function(env, suite, description) {
spec.results_ = new jasmine.NestedResults();
spec.results_.description = description;
spec.matchersClass = null;
+ spec.exclusive_ = suite.exclusive_;
};
jasmine.Spec.prototype.getFullName = function() {
@@ -2461,6 +2543,7 @@ jasmine.Suite = function(env, description, specDefinitions, parentSuite) {
self.children_ = [];
self.suites_ = [];
self.specs_ = [];
+ self.exclusive_ = parentSuite && parentSuite.exclusive_ || 0;
};
jasmine.Suite.prototype.getFullName = function() {
View
13 lib/jasmine-node/reporter.js
@@ -322,6 +322,19 @@
// Inherit from TerminalReporter
jasmineNode.TerminalVerboseReporter.prototype.__proto__ = jasmineNode.TerminalReporter.prototype;
+ // Extend Teamcity Reporter
+ jasmineNode.TeamcityReporter = function(config) {
+ var callback_ = config.onComplete || false;
+
+ (function(superFn) {
+ jasmineNode.TeamcityReporter.prototype.reportRunnerResults = function(runner) {
+ superFn.call(this, runner);
+ if (callback_) {callback_(runner)}
+ }
+ }(jasmine.TeamcityReporter.prototype.reportRunnerResults));
+ };
+ jasmineNode.TeamcityReporter.prototype = new jasmine.TeamcityReporter;
+
//
// Exports
//
View
4 package.json
@@ -1,6 +1,6 @@
{
"name": "jasmine-node",
- "version": "1.13.1",
+ "version": "1.14.5",
"description": "DOM-less simple JavaScript BDD testing framework for Node",
"contributors": [
"Chris Moultrie <chris@moultrie.org>"
@@ -24,7 +24,7 @@
],
"dependencies": {
"coffee-script": ">=1.0.1",
- "jasmine-reporters": ">=0.2.0",
+ "jasmine-reporters": "~1.0.0",
"jasmine-growl-reporter": "~0.0.2",
"requirejs": ">=0.27.1",
"walkdir": ">= 0.0.1",

Showing you all comments on commits in this comparison.

@Krinkle

Looks like this tag is missing from git?

Something went wrong with that request. Please try again.