diff --git a/package.json b/package.json index d00f775..47c5dac 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,11 @@ "description": "Infinitely generating linked list with memoisation (or an n-generator)", "main": "es5/infinity.min.js", "scripts": { - "test": "jasmine", - "build": "./build.sh && jasmine", - "prepublishOnly": "npm run build", - "release": "npm run build && npm publish" + "build": "./build.sh", + "test:es6": "NODE_ENV=development jasmine", + "test:es5": "NODE_ENV=production npm run build && jasmine", + "test": "npm run test:es6 && npm run test:es5", + "prepublishOnly": "npm test" }, "keywords": [ "infinite", diff --git a/spec/spec.js b/spec/spec.js index 8e2a1f3..650d43d 100644 --- a/spec/spec.js +++ b/spec/spec.js @@ -1,10 +1,11 @@ 'use strict'; -const InfiniteList = require('../es6'); +const path = '..' + (process.env.NODE_ENV === 'development' ? '/es6' : '/es5/infinity.min.js'); -const { - InfiniteListItem -} = require('..'); +const InfiniteList = require(path); +const { InfiniteListItem } = require(path); + +console.log(`\nTesting ${path}\n`); String.prototype.trimify = function() { return this.replace(/\s/g, ''); @@ -40,7 +41,7 @@ describe("InfiniteList", () => { it("Should be true", () => { const Infinite = new InfiniteList(0, x => x + 2); - expect((Infinite.get(5)) instanceof InfiniteListItem).toBe(true); + expect(Infinite.get(5) instanceof InfiniteListItem).toBe(true); }); it("Should be 22", () => {