Fixing phantomjs test cases now that there is no sub-packages for test.
This commit is contained in:
parent
e67a66f900
commit
b2ada0cda9
@ -4,11 +4,12 @@ var fs = require('fs');
|
|||||||
|
|
||||||
// Create a mock-fs module that can load our gzipped test cases
|
// Create a mock-fs module that can load our gzipped test cases
|
||||||
var data = {};
|
var data = {};
|
||||||
fs.readdirSync('tests').forEach(function(filename) {
|
fs.readdirSync('tests/tests').forEach(function(filename) {
|
||||||
filename = 'tests/' + filename;
|
if (!filename.match(/\.json\.gz$/)) { return; }
|
||||||
|
filename = 'tests/tests/' + filename;
|
||||||
data['/' + filename] = fs.readFileSync(filename).toString('base64');
|
data['/' + filename] = fs.readFileSync(filename).toString('base64');
|
||||||
});
|
});
|
||||||
fs.writeFileSync('./dist/tests.json', JSON.stringify(data));
|
fs.writeFileSync('./tests/dist/tests.json', JSON.stringify(data));
|
||||||
|
|
||||||
|
|
||||||
module.exports = function(grunt) {
|
module.exports = function(grunt) {
|
||||||
@ -16,7 +17,7 @@ module.exports = function(grunt) {
|
|||||||
browserify: {
|
browserify: {
|
||||||
dist: {
|
dist: {
|
||||||
files: {
|
files: {
|
||||||
'dist/tests.js': './browser.js',
|
'tests/dist/tests.js': './tests/browser.js',
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
browserifyOptions: {
|
browserifyOptions: {
|
@ -6,7 +6,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "if [ \"$RUN_PHANTOMJS\" = \"1\" ]; then npm run-script test-phantomjs; else npm run-script test-node; fi",
|
"test": "if [ \"$RUN_PHANTOMJS\" = \"1\" ]; then npm run-script test-phantomjs; else npm run-script test-node; fi",
|
||||||
"test-node": "./node_modules/.bin/mocha tests/test-*.js",
|
"test-node": "./node_modules/.bin/mocha tests/test-*.js",
|
||||||
"test-phantomjs": "./node_modules/.bin/grunt --gruntfile tests/Gruntfile.js dist && phantomjs --web-security=false ./node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js ./tests/test.html",
|
"test-phantomjs": "./node_modules/.bin/grunt --gruntfile Gruntfile-test.js dist && phantomjs --web-security=false ./node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js ./tests/test.html",
|
||||||
"version": "grunt dist"
|
"version": "grunt dist"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -22,6 +22,7 @@
|
|||||||
"xmlhttprequest": "1.8.0"
|
"xmlhttprequest": "1.8.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"browserify-zlib": "^0.2.0",
|
||||||
"grunt": "^0.4.5",
|
"grunt": "^0.4.5",
|
||||||
"grunt-browserify": "^5.0.0",
|
"grunt-browserify": "^5.0.0",
|
||||||
"grunt-cli": "1.2.0",
|
"grunt-cli": "1.2.0",
|
||||||
@ -32,6 +33,8 @@
|
|||||||
"web3": "0.20.2"
|
"web3": "0.20.2"
|
||||||
},
|
},
|
||||||
"browser": {
|
"browser": {
|
||||||
|
"fs": "./tests/browser-fs.js",
|
||||||
|
"zlib": "browserify-zlib",
|
||||||
"./utils/random-bytes.js": "./utils/browser-random-bytes.js",
|
"./utils/random-bytes.js": "./utils/browser-random-bytes.js",
|
||||||
"xmlhttprequest": "./providers/browser-xmlhttprequest.js"
|
"xmlhttprequest": "./providers/browser-xmlhttprequest.js"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user