2017-10-23 00:47:17 +03:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var fs = require('fs');
|
|
|
|
|
|
|
|
// Create a mock-fs module that can load our gzipped test cases
|
|
|
|
var data = {};
|
2018-03-05 04:00:46 +03:00
|
|
|
fs.readdirSync('tests/tests').forEach(function(filename) {
|
|
|
|
if (!filename.match(/\.json\.gz$/)) { return; }
|
|
|
|
filename = 'tests/tests/' + filename;
|
2017-10-23 00:47:17 +03:00
|
|
|
data['/' + filename] = fs.readFileSync(filename).toString('base64');
|
|
|
|
});
|
2018-03-05 04:00:46 +03:00
|
|
|
fs.writeFileSync('./tests/dist/tests.json', JSON.stringify(data));
|
2017-10-23 00:47:17 +03:00
|
|
|
|
2017-03-08 09:55:02 +03:00
|
|
|
|
|
|
|
module.exports = function(grunt) {
|
|
|
|
grunt.initConfig({
|
|
|
|
browserify: {
|
|
|
|
dist: {
|
|
|
|
files: {
|
2018-03-05 04:00:46 +03:00
|
|
|
'tests/dist/tests.js': './tests/browser.js',
|
2017-03-08 09:55:02 +03:00
|
|
|
},
|
|
|
|
options: {
|
|
|
|
browserifyOptions: {
|
|
|
|
standalone: 'tests',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
grunt.loadNpmTasks('grunt-browserify');
|
|
|
|
|
|
|
|
grunt.registerTask('dist', ['browserify']);
|
|
|
|
};
|