Browse Source

[npm] New scripts!

master
Muthu Kumar 6 years ago
parent
commit
93c891c146
  1. 9
      package.json
  2. 11
      spec/spec.js

9
package.json

@ -4,10 +4,11 @@
"description": "Infinitely generating linked list with memoisation (or an n-generator)", "description": "Infinitely generating linked list with memoisation (or an n-generator)",
"main": "es5/infinity.min.js", "main": "es5/infinity.min.js",
"scripts": { "scripts": {
"test": "jasmine", "build": "./build.sh",
"build": "./build.sh && jasmine", "test:es6": "NODE_ENV=development jasmine",
"prepublishOnly": "npm run build", "test:es5": "NODE_ENV=production npm run build && jasmine",
"release": "npm run build && npm publish" "test": "npm run test:es6 && npm run test:es5",
"prepublishOnly": "npm test"
}, },
"keywords": [ "keywords": [
"infinite", "infinite",

11
spec/spec.js

@ -1,10 +1,11 @@
'use strict'; 'use strict';
const InfiniteList = require('../es6'); const path = '..' + (process.env.NODE_ENV === 'development' ? '/es6' : '/es5/infinity.min.js');
const { const InfiniteList = require(path);
InfiniteListItem const { InfiniteListItem } = require(path);
} = require('..');
console.log(`\nTesting ${path}\n`);
String.prototype.trimify = function() { String.prototype.trimify = function() {
return this.replace(/\s/g, ''); return this.replace(/\s/g, '');
@ -40,7 +41,7 @@ describe("InfiniteList", () => {
it("Should be true", () => { it("Should be true", () => {
const Infinite = new InfiniteList(0, x => x + 2); 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", () => { it("Should be 22", () => {

Loading…
Cancel
Save