Skip to content

Commit

Permalink
Fix npm run test-native
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jan 14, 2015
1 parent 4dcea4c commit d8445f5
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 22 deletions.
4 changes: 2 additions & 2 deletions test/array.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*global describe, it, expect, require, beforeEach */

var exported = require('../');

var runArrayTests = function () {
'use strict';
Expand All @@ -15,7 +14,8 @@ var runArrayTests = function () {
describe('Array', function () {
var list = [5, 10, 15, 20];

it('is on the exported object', function () {
(process.env.NO_ES6_SHIM ? it.skip : it)('is on the exported object', function () {
var exported = require('../');
expect(exported.Array).to.equal(Array);
});

Expand Down
7 changes: 4 additions & 3 deletions test/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

// Big thanks to V8 folks for test ideas.
// v8/test/mjsunit/harmony/collections.js
var exported = require('../');

var Assertion = expect().constructor;
Assertion.addMethod('theSameSet', function (otherArray) {
Expand Down Expand Up @@ -56,7 +55,8 @@ describe('Collections', function () {
map = null;
});

it('is on the exported object', function () {
(process.env.NO_ES6_SHIM ? it.skip : it)('is on the exported object', function () {
var exported = require('../');
expect(exported.Map).to.equal(Map);
});

Expand Down Expand Up @@ -455,7 +455,8 @@ describe('Collections', function () {
set = null;
});

it('is on the exported object', function () {
(process.env.NO_ES6_SHIM ? it.skip : it)('is on the exported object', function () {
var exported = require('../');
expect(exported.Set).to.equal(Set);
});

Expand Down
5 changes: 2 additions & 3 deletions test/math.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*global describe, it, expect, require */

var exported = require('../');

var Assertion = expect().constructor;
Assertion.prototype.almostEqual = function (obj, precision) {
'use strict';
Expand All @@ -22,7 +20,8 @@ var valueOfIsNaN = { valueOf: function () { 'use strict'; return NaN; } };
var valueOfIsInfinity = { valueOf: function () { 'use strict'; return Infinity; } };

describe('Math', function () {
it('is on the exported object', function () {
(process.env.NO_ES6_SHIM ? it.skip : it)('is on the exported object', function () {
var exported = require('../');
expect(exported.Math).to.equal(Math);
});

Expand Down
5 changes: 2 additions & 3 deletions test/number.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*global describe, it, expect, require */

var exported = require('../');

describe('Number', function (undefined) {
var integers = [5295, -5295, -9007199254740991, 9007199254740991, 0, -0];
var nonIntegers = [-9007199254741992, 9007199254741992, 5.9];
Expand Down Expand Up @@ -32,7 +30,8 @@ describe('Number', function (undefined) {
expect(item).to.equal(false);
};

it('is on the exported object', function () {
(process.env.NO_ES6_SHIM ? it.skip : it)('is on the exported object', function () {
var exported = require('../');
expect(exported.Number).to.equal(Number);
});

Expand Down
5 changes: 2 additions & 3 deletions test/object.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/*global describe, it, expect, require */

var exported = require('../');

describe('Object', function (undefined) {
it('is on the exported object', function () {
(process.env.NO_ES6_SHIM ? it.skip : it)('is on the exported object', function () {
var exported = require('../');
expect(exported.Object).to.equal(Object);
});

Expand Down
4 changes: 2 additions & 2 deletions test/promise.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*global describe, it, expect, require, Promise */

/* This file is for testing implementation regressions of Promises. */
var exported = require('../');
var hasOwn = Object.prototype.hasOwnProperty;

describe('Promise', function () {
it('is on the exported object', function () {
(process.env.NO_ES6_SHIM ? it.skip : it)('is on the exported object', function () {
var exported = require('../');
expect(exported.Promise).to.equal(Promise);
});

Expand Down
4 changes: 4 additions & 0 deletions test/promise/promises-aplus.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
describe('Promises/A+ Tests', function () {
'use strict';

if (typeof Promise === 'undefined') {
return;
}

require('promises-aplus-tests').mocha({
// an adapter from es6 spec to Promises/A+
deferred: function () {
Expand Down
4 changes: 4 additions & 0 deletions test/promise/promises-es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
(function () {
'use strict';

if (typeof Promise === 'undefined') {
return;
}

describe('Promises/ES6 Tests', function () {

// an adapter that sets up global.Promise
Expand Down
5 changes: 2 additions & 3 deletions test/regexp.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*global describe, it, xit, expect, require */

var exported = require('../');

var getRegexLiteral = function (stringRegex) {
try {
/*jshint evil: true */
Expand All @@ -11,7 +9,8 @@ var getRegexLiteral = function (stringRegex) {
};

describe('RegExp', function () {
it('is on the exported object', function () {
(process.env.NO_ES6_SHIM ? it.skip : it)('is on the exported object', function () {
var exported = require('../');
expect(exported.RegExp).to.equal(RegExp);
});

Expand Down
5 changes: 2 additions & 3 deletions test/string.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*global describe, it, expect, require */

var exported = require('../');

var runStringTests = function () {
'use strict';
describe('String', function () {
Expand All @@ -15,7 +13,8 @@ var runStringTests = function () {
expect(function () { return fn.apply(null); }).to['throw'](TypeError);
};

it('is on the exported object', function () {
(process.env.NO_ES6_SHIM ? it.skip : it)('is on the exported object', function () {
var exported = require('../');
expect(exported.String).to.equal(String);
});

Expand Down

0 comments on commit d8445f5

Please sign in to comment.