Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
test: add Browserify environment test
Browse files Browse the repository at this point in the history
  • Loading branch information
unframework authored and btford committed Apr 10, 2015
1 parent 63b42bd commit 5d6bee4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
6 changes: 4 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ module.exports = function (config) {

reporters: ['progress'],

preprocessors: {},
preprocessors: {
'test/commonjs.spec.js': [ 'browserify' ]
},

//port: 9876,
colors: true,

logLevel: config.LOG_INFO,

browsers: ['Firefox'],
frameworks: ['jasmine'],
frameworks: ['jasmine', 'browserify'],

captureTimeout: 60000,

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"devDependencies": {
"jasmine-core": "^2.2.0",
"karma": "^0.12.31",
"karma-browserify": "^4.1.2",
"karma-chrome-launcher": "^0.1.7",
"karma-firefox-launcher": "^0.1.4",
"karma-jasmine": "^0.3.5",
Expand Down
19 changes: 19 additions & 0 deletions test/commonjs.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';

describe('Zone in CommonJS environment', function () {
var commonJSExports, globalZone;

beforeEach(function () {
globalZone = window.Zone;
commonJSExports = require('../zone.js');
});

it('defines proper exports properties in CommonJS environment', function () {
expect(commonJSExports.zone).toBeDefined();
expect(commonJSExports.Zone).toBeDefined();
});

it('does not set global Zone constructor when required in CommonJS environment', function () {
expect(commonJSExports.Zone).not.toBe(globalZone);
});
});

0 comments on commit 5d6bee4

Please sign in to comment.