mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Fixed tests running in Node v6
This commit is contained in:
parent
714298d071
commit
7aebff2961
@ -12,11 +12,10 @@
|
||||
"url": "https://github.com/marko-js/marko.git"
|
||||
},
|
||||
"scripts": {
|
||||
"init-tests": "./test/init-tests.sh",
|
||||
"test": "npm run init-tests && node_modules/.bin/mocha --ui bdd --reporter spec ./test && node_modules/.bin/jshint compiler/ runtime/ taglibs/",
|
||||
"test-fast": "npm run init-tests && node_modules/.bin/mocha --ui bdd --reporter spec ./test/render-test",
|
||||
"test-async": "npm run init-tests && node_modules/.bin/mocha --ui bdd --reporter spec ./test/render-async-test",
|
||||
"test-taglib-loader": "npm run init-tests && node_modules/.bin/mocha --ui bdd --reporter spec ./test/taglib-loader-test",
|
||||
"test": "node_modules/.bin/mocha --ui bdd --reporter spec ./test && node_modules/.bin/jshint compiler/ runtime/ taglibs/",
|
||||
"test-fast": "node_modules/.bin/mocha --ui bdd --reporter spec ./test/render-test",
|
||||
"test-async": "node_modules/.bin/mocha --ui bdd --reporter spec ./test/render-async-test",
|
||||
"test-taglib-loader": "node_modules/.bin/mocha --ui bdd --reporter spec ./test/taglib-loader-test",
|
||||
"jshint": "node_modules/.bin/jshint compiler/ runtime/ taglibs/"
|
||||
},
|
||||
"author": "Patrick Steele-Idem <pnidem@gmail.com>",
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
'use strict';
|
||||
require('./patch-module');
|
||||
|
||||
var chai = require('chai');
|
||||
chai.config.includeStack = true;
|
||||
var path = require('path');
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
'use strict';
|
||||
require('./patch-module');
|
||||
|
||||
var chai = require('chai');
|
||||
chai.config.includeStack = true;
|
||||
var expect = require('chai').expect;
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
'use strict';
|
||||
require('./patch-module');
|
||||
|
||||
var chai = require('chai');
|
||||
chai.config.includeStack = true;
|
||||
var path = require('path');
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
require('./patch-module');
|
||||
|
||||
var chai = require('chai');
|
||||
chai.config.includeStack = true;
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
require('./patch-module');
|
||||
|
||||
var chai = require('chai');
|
||||
chai.config.includeStack = true;
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
require('./patch-module');
|
||||
|
||||
var chai = require('chai');
|
||||
chai.config.includeStack = true;
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
'use strict';
|
||||
require('./patch-module');
|
||||
|
||||
var chai = require('chai');
|
||||
chai.config.includeStack = true;
|
||||
var expect = require('chai').expect;
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
DIR=`dirname $0`
|
||||
|
||||
cd ${DIR}
|
||||
|
||||
if [ ! -L "./node_modules/marko" ]; then
|
||||
mkdir -p node_modules
|
||||
ln -s ../../ node_modules/marko
|
||||
fi
|
||||
@ -1,4 +1,6 @@
|
||||
'use strict';
|
||||
require('./patch-module');
|
||||
|
||||
var chai = require('chai');
|
||||
chai.config.includeStack = true;
|
||||
var autotest = require('./autotest');
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
'use strict';
|
||||
require('./patch-module');
|
||||
|
||||
var chai = require('chai');
|
||||
chai.config.includeStack = true;
|
||||
var parseFor = require('../taglibs/core/util/parseFor.js');
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
'use strict';
|
||||
require('./patch-module');
|
||||
|
||||
var chai = require('chai');
|
||||
chai.config.includeStack = true;
|
||||
var compiler = require('../compiler');
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
require('./patch-module');
|
||||
|
||||
var chai = require('chai');
|
||||
chai.config.includeStack = true;
|
||||
|
||||
13
test/patch-module.js
Normal file
13
test/patch-module.js
Normal file
@ -0,0 +1,13 @@
|
||||
var nodePath = require('path');
|
||||
|
||||
var Module = require('module').Module;
|
||||
var oldResolveFilename = Module._resolveFilename;
|
||||
|
||||
var rootDir = nodePath.join(__dirname, '../');
|
||||
Module._resolveFilename = function(request, parent, isMain) {
|
||||
if (request.startsWith('marko')) {
|
||||
request = request.substring('marko'.length);
|
||||
request = rootDir + request;
|
||||
}
|
||||
return oldResolveFilename.call(this, request, parent, isMain);
|
||||
};
|
||||
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
require('./patch-module');
|
||||
|
||||
var chai = require('chai');
|
||||
chai.config.includeStack = true;
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
'use strict';
|
||||
require('./patch-module');
|
||||
|
||||
var chai = require('chai');
|
||||
chai.config.includeStack = true;
|
||||
var path = require('path');
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
'use strict';
|
||||
require('./patch-module');
|
||||
|
||||
var chai = require('chai');
|
||||
chai.config.includeStack = true;
|
||||
require('chai').should();
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
'use strict';
|
||||
require('./patch-module');
|
||||
|
||||
var chai = require('chai');
|
||||
chai.config.includeStack = true;
|
||||
require('chai').should();
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
'use strict';
|
||||
require('./patch-module');
|
||||
|
||||
var chai = require('chai');
|
||||
chai.config.includeStack = true;
|
||||
require('chai').should();
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
require('./patch-module');
|
||||
|
||||
var chai = require('chai');
|
||||
chai.config.includeStack = true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user