2
0
mirror of https://github.com/iconify/iconify.git synced 2024-11-17 01:55:09 +00:00
iconify/tests/browser/renderer_test.build.js

40 lines
1.2 KiB
JavaScript
Raw Normal View History

2017-02-22 15:25:57 +00:00
/**
* Build test
*/
"use strict";
const fs = require('fs');
module.exports = (Helper, codeDir, testFile, TestHelper) => {
2017-02-22 15:25:57 +00:00
let code = fs.readFileSync(testFile, 'utf8'),
modules = [
// Core
TestHelper.fakeEvents(),
TestHelper.fakeInit(),
2017-02-22 15:25:57 +00:00
// Common files
TestHelper.getStorage(),
fs.readFileSync(codeDir + '/browser/storage.js', 'utf8'),
TestHelper.getSVG(),
2017-02-22 15:25:57 +00:00
// Files needed for test
2017-02-22 15:25:57 +00:00
fs.readFileSync(codeDir + '/browser/defaults.js', 'utf8'),
fs.readFileSync(codeDir + '/browser/with-cdn/defaults.js', 'utf8'),
2017-02-22 15:25:57 +00:00
fs.readFileSync(codeDir + '/browser/config.js', 'utf8'),
fs.readFileSync(codeDir + '/browser/image.js', 'utf8'),
fs.readFileSync(codeDir + '/browser/finder.js', 'utf8'),
fs.readFileSync(codeDir + '/browser/with-cdn/loader.js', 'utf8'),
// Main file
2017-02-22 15:25:57 +00:00
fs.readFileSync(codeDir + '/browser/renderer.js', 'utf8'),
];
// Replace code
modules = modules.join('');
2017-02-22 15:25:57 +00:00
// Merge modules and test
code = code.replace('/* Modules() */', modules);
return code;
};