From 47e709a91adca393f9aaccd7bae635f891d99135 Mon Sep 17 00:00:00 2001 From: miripiruni Date: Tue, 14 Mar 2017 15:58:22 +0300 Subject: [PATCH 1/3] Tests: fixed fs mock --- test/techs/bemhtml.test.js | 3 +++ test/techs/bemtree.test.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/test/techs/bemhtml.test.js b/test/techs/bemhtml.test.js index 963d194..47ae56a 100644 --- a/test/techs/bemhtml.test.js +++ b/test/techs/bemhtml.test.js @@ -301,6 +301,9 @@ function build(templates, options) { }); } + var bemhtmlPath = './node_modules/bem-xjst/lib/bemhtml/bundle.js' + scheme[bemhtmlPath] = require('fs').readFileSync(bemhtmlPath, 'utf8'); + mock(scheme); bundle = new MockNode('bundle'); diff --git a/test/techs/bemtree.test.js b/test/techs/bemtree.test.js index b766e90..630ac50 100644 --- a/test/techs/bemtree.test.js +++ b/test/techs/bemtree.test.js @@ -213,6 +213,9 @@ function build(templates, options) { }); } + var bemtreePath = './node_modules/bem-xjst/lib/bemtree/bundle.js' + scheme[bemtreePath] = require('fs').readFileSync(bemtreePath, 'utf8'); + mock(scheme); bundle = new MockNode('bundle'); From fb50e3bbd6d18e46e33ef802fde6b1a119462e83 Mon Sep 17 00:00:00 2001 From: miripiruni Date: Tue, 14 Mar 2017 16:18:04 +0300 Subject: [PATCH 2/3] npm scripts: prepublish --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 0491b48..4ce229e 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "ym": "^0.1.2" }, "scripts": { + "prepublish": "npm test", "pretest": "eslint . && jscs -c .jscs.js .", "test": "mocha -R spec", "cover": "istanbul cover _mocha", From 9929d33ee87998b4be68c608144fa6bd92ca564d Mon Sep 17 00:00:00 2001 From: miripiruni Date: Wed, 15 Mar 2017 14:55:29 +0300 Subject: [PATCH 3/3] Test: comments about mock-fs --- test/techs/bemhtml.test.js | 1 + test/techs/bemtree.test.js | 1 + 2 files changed, 2 insertions(+) diff --git a/test/techs/bemhtml.test.js b/test/techs/bemhtml.test.js index 47ae56a..7c98aef 100644 --- a/test/techs/bemhtml.test.js +++ b/test/techs/bemhtml.test.js @@ -301,6 +301,7 @@ function build(templates, options) { }); } + // mock for bemhtml.generate() var bemhtmlPath = './node_modules/bem-xjst/lib/bemhtml/bundle.js' scheme[bemhtmlPath] = require('fs').readFileSync(bemhtmlPath, 'utf8'); diff --git a/test/techs/bemtree.test.js b/test/techs/bemtree.test.js index 630ac50..3609a34 100644 --- a/test/techs/bemtree.test.js +++ b/test/techs/bemtree.test.js @@ -213,6 +213,7 @@ function build(templates, options) { }); } + // mock for bemhtml.generate() var bemtreePath = './node_modules/bem-xjst/lib/bemtree/bundle.js' scheme[bemtreePath] = require('fs').readFileSync(bemtreePath, 'utf8');