Skip to content

Commit

Permalink
Migrate specs to Mr
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Oct 30, 2013
1 parent a5233e6 commit 4246019
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 65 deletions.
1 change: 0 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ module.exports = function (grunt) {
}
});

grunt.registerTask("pre-browser-test", ["clean", "globalwrap"]);
grunt.registerTask("build", ["clean", "amdwrap", "globalwrap", "uglify"]);
grunt.registerTask("release", ["clean", "amdwrap", "globalwrap", "uglify", "s3"]);
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@
"matcha": "~0.2.0",
"grunt-global-wrap": "~1.1.0",
"grunt-amd-wrap": "~1.0.0",
"grunt-s3": "~0.2.0-alpha.2"
"grunt-s3": "~0.2.0-alpha.2",
"mr": "~0.13.3"
},
"scripts": {
"test": "jasmine-node spec && promises-aplus-tests spec/aplus-adapter",
"test-browser": "grunt pre-browser-test && opener spec/q-spec.html",
"release": "grunt release",
"benchmark": "matcha",
"lint": "jshint q.js",
Expand Down
17 changes: 17 additions & 0 deletions spec/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<title>Jasmine Spec Runner</title>
<meta charset="utf-8" />

<link rel="shortcut icon" type="image/png" href="lib/jasmine-1.2.0/jasmine_favicon.png" />
<link rel="stylesheet" href="lib/jasmine-1.2.0/jasmine.css" />
<script src="lib/jasmine-1.2.0/jasmine.js"></script>
<script src="lib/jasmine-1.2.0/jasmine-html.js"></script>
<script src="../node_modules/mr/bootstrap.js" data-package=".." data-module="spec/index"></script>

</head>

<body>
</body>
</html>
17 changes: 17 additions & 0 deletions spec/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

require("./lib/jasmine-promise");
require("./q-spec");

var jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 1000;

var htmlReporter = new jasmine.HtmlReporter();

jasmineEnv.addReporter(htmlReporter);

jasmineEnv.specFilter = function(spec) {
return htmlReporter.specFilter(spec);
};

jasmineEnv.execute();

2 changes: 2 additions & 0 deletions spec/lib/jasmine-promise.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"use strict";

var Q = require("../../q");

/**
* Modifies the way that individual specs are run to easily test async
* code with promises.
Expand Down
53 changes: 0 additions & 53 deletions spec/q-spec.html

This file was deleted.

17 changes: 8 additions & 9 deletions spec/q-spec.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
"use strict";
/*jshint newcap: false*/
/*global Q: true, describe: false, it: false, expect: false, beforeEach: false,
/*global describe: false, it: false, expect: false, beforeEach: false,
afterEach: false, require: false, jasmine: false, waitsFor: false,
runs: false */

if (typeof Q === "undefined" && typeof require !== "undefined") {
// For Node compatibility.
global.Q = require("../q");
global.asap = require("asap");
require("./lib/jasmine-promise");
}
var Q = require("../q");
var asap = require("asap");

var REASON = "this is not an error, but it might show up in the console";

Expand Down Expand Up @@ -2198,12 +2194,14 @@ describe("isPromiseAlike", function () {

if (typeof require === "function") {
var domain;
// using (require) instead of require tricks the browser-side dependency
// analysis heuristic into not recognizing the dependency.
try {
domain = require("domain");
domain = (require)("domain");
} catch (e) { }

if (domain) {
var EventEmitter = require("events").EventEmitter;
var EventEmitter = (require)("events").EventEmitter;

describe("node domain support", function () {
var d;
Expand Down Expand Up @@ -2489,3 +2487,4 @@ describe("unhandled rejection reporting", function () {
expect(Q.getUnhandledReasons()).toEqual([]);
});
});

0 comments on commit 4246019

Please sign in to comment.