2bc4731f by David LaPalomento

Rename parsed manifests from json to js

Custom IVs are naturally expressed as Uint8Arrays but our expected manifest format was json. Swap to plain JS so we don't have to do anything hacky for testing with custom IVs.
1 parent 45968d1e
Showing 41 changed files with 4 additions and 17 deletions
...@@ -203,7 +203,7 @@ module.exports = function(grunt) { ...@@ -203,7 +203,7 @@ module.exports = function(grunt) {
203 grunt.loadNpmTasks('grunt-open'); 203 grunt.loadNpmTasks('grunt-open');
204 grunt.loadNpmTasks('grunt-concurrent'); 204 grunt.loadNpmTasks('grunt-concurrent');
205 grunt.loadNpmTasks('grunt-contrib-watch'); 205 grunt.loadNpmTasks('grunt-contrib-watch');
206 206
207 207
208 grunt.registerTask('manifests-to-js', 'Wrap the test fixtures and output' + 208 grunt.registerTask('manifests-to-js', 'Wrap the test fixtures and output' +
209 ' so they can be loaded in a browser', 209 ' so they can be loaded in a browser',
...@@ -230,10 +230,10 @@ module.exports = function(grunt) { ...@@ -230,10 +230,10 @@ module.exports = function(grunt) {
230 jsManifests += ',\n'; 230 jsManifests += ',\n';
231 } 231 }
232 232
233 if ((/\.json$/).test(abspath)) { 233 if ((/\.js$/).test(abspath)) {
234 234
235 // append the JSON 235 // append the expected parse
236 jsExpected += ' "' + basename(filename, '.json') + '": ' + 236 jsExpected += ' "' + basename(filename, '.js') + '": ' +
237 grunt.file.read(abspath) + ',\n'; 237 grunt.file.read(abspath) + ',\n';
238 } 238 }
239 }); 239 });
......
1 var grunt = require('grunt'),
2 extname = require('path').extname;
3
4 grunt.file.recurse(process.cwd(), function(path) {
5 var json;
6 if (extname(path) === '.json') {
7 json = grunt.file.readJSON(path);
8 if (json.totalDuration) {
9 delete json.totalDuration;
10 grunt.file.write(path, JSON.stringify(json, null, ' '));
11 }
12 }
13 });