2
0
mirror of synced 2025-02-24 20:18:07 +00:00

Fixing phantomjs test cases now that there is no sub-packages for test.

This commit is contained in:
Richard Moore 2018-03-04 20:00:46 -05:00
parent e67a66f900
commit b2ada0cda9
No known key found for this signature in database
GPG Key ID: 525F70A6FCABC295
2 changed files with 9 additions and 5 deletions

View File

@ -4,11 +4,12 @@ var fs = require('fs');
// Create a mock-fs module that can load our gzipped test cases
var data = {};
fs.readdirSync('tests').forEach(function(filename) {
filename = 'tests/' + filename;
fs.readdirSync('tests/tests').forEach(function(filename) {
if (!filename.match(/\.json\.gz$/)) { return; }
filename = 'tests/tests/' + filename;
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) {
@ -16,7 +17,7 @@ module.exports = function(grunt) {
browserify: {
dist: {
files: {
'dist/tests.js': './browser.js',
'tests/dist/tests.js': './tests/browser.js',
},
options: {
browserifyOptions: {

View File

@ -6,7 +6,7 @@
"scripts": {
"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-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"
},
"dependencies": {
@ -22,6 +22,7 @@
"xmlhttprequest": "1.8.0"
},
"devDependencies": {
"browserify-zlib": "^0.2.0",
"grunt": "^0.4.5",
"grunt-browserify": "^5.0.0",
"grunt-cli": "1.2.0",
@ -32,6 +33,8 @@
"web3": "0.20.2"
},
"browser": {
"fs": "./tests/browser-fs.js",
"zlib": "browserify-zlib",
"./utils/random-bytes.js": "./utils/browser-random-bytes.js",
"xmlhttprequest": "./providers/browser-xmlhttprequest.js"
},