Skip to content

Commit c13e4aa

Browse files
committed
Merge pull request #23 from firebase/jw-tests
Fixed broken test suite
2 parents 98213f2 + 86d9262 commit c13e4aa

File tree

5 files changed

+17
-11
lines changed

5 files changed

+17
-11
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ install:
55
- npm install -g bower
66
- npm install
77
- bower install
8+
before_script:
9+
- export DISPLAY=:99.0
10+
- sh -e /etc/init.d/xvfb start
811
script:
912
- npm run travis
1013
after_script:

gulpfile.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var uglify = require("gulp-uglify");
1313
var karma = require("gulp-karma");
1414

1515
// Determine if this is being run in Travis
16-
var travis = (process.argv.indexOf('--travis') > -1);
16+
var travis = false;
1717

1818

1919
/****************/
@@ -97,6 +97,7 @@ gulp.task("test", function() {
9797
return gulp.src(paths.tests.files)
9898
.pipe(karma({
9999
configFile: paths.tests.config,
100+
browsers: travis ? ["Firefox"] : ["Chrome"],
100101
action: "run"
101102
}))
102103
.on("error", function(error) {
@@ -112,5 +113,11 @@ gulp.task("watch", function() {
112113
/* Builds the distribution files */
113114
gulp.task("build", ["scripts"]);
114115

115-
/* Runs the "test" and "scripts" tasks by default */
116-
gulp.task("default", ["test", "scripts"]);
116+
/* Tasks to be run within Travis CI */
117+
gulp.task("travis", function() {
118+
travis = true;
119+
gulp.start("build", "test");
120+
});
121+
122+
/* Runs the "scripts" and "test" tasks by default */
123+
gulp.task("default", ["build", "test"]);

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,16 @@
4545
"gulp-uglify": "^0.2.1",
4646
"jshint-stylish": "^0.2.0",
4747
"karma": "^0.12.16",
48+
"karma-chrome-launcher": "^0.1.5",
4849
"karma-coverage": "^0.2.4",
4950
"karma-failed-reporter": "0.0.2",
51+
"karma-firefox-launcher": "^0.1.3",
5052
"karma-jasmine": "~0.2.0",
51-
"karma-phantomjs-launcher": "~0.1.4",
5253
"karma-spec-reporter": "0.0.13",
5354
"streamqueue": "^0.1.1"
5455
},
5556
"scripts": {
5657
"test": "gulp test",
57-
"travis": "gulp --travis"
58+
"travis": "gulp travis"
5859
}
5960
}

tests/karma.conf.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
// Configuration file for Karma test runner
21
module.exports = function(config) {
32
config.set({
43
frameworks: ["jasmine"],
5-
browsers: ["PhantomJS"],
64
autowatch: false,
75
singleRun: true,
86

tests/specs/common.spec.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
// Override the default timeout interval for Jasmine
55
jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
66

7-
// Get a reference to a random demo Firebase
8-
var demoFirebaseUrl = "https://" + generateRandomString() + ".firebaseio-demo.com";
9-
107
// React test addon
118
var ReactTestUtils = React.addons.TestUtils;
129

@@ -21,7 +18,7 @@ var invalidBindVars = ["", 1, true, false, [], {}, [1, 2], {a: 1}, null, undefin
2118
/* Helper function which runs before each Jasmine test has started */
2219
function beforeEachHelper(done) {
2320
// Create a new firebase ref with a new context
24-
firebaseRef = new Firebase(demoFirebaseUrl, Firebase.Context());
21+
firebaseRef = new Firebase("https://tests.firebaseio.com", Firebase.Context());
2522

2623
// Reset the Firebase
2724
firebaseRef.remove(function() {

0 commit comments

Comments
 (0)