async function uploadData (uploadURL, authToken, filename, opts) { // filename may either be .clinic-doctor.html or the data directory // .clinic-doctor const filePrefix = path.join(filename).replace(/\.html$/, '') const isPrivate = opts && opts.private console.log(`Uploading data for ${filePrefix} and ${filePrefix}.html`) const result = await tarAndUploadPromisified(path.resolve(filePrefix), uploadURL, authToken, { private: isPrivate }) result.url = `${uploadURL}${result.html}` return result }
app.beforeStart(function*() { // dumpConfig() dynamically json = readJSON(path.join(baseDir, 'run/application_config.json')); assert(json.config.dynamic === 1, 'should dump in config'); json = readJSON(path.join(baseDir, 'run/agent_config.json')); assert(json.config.dynamic === 0, 'should dump in config'); yield sleep(2000); app.config.dynamic = 2; });
beforeAll(async function(state) { const DEVTOOLS_DIR = path.dirname( require.resolve('chrome-devtools-frontend/front_end/shell.json')); const frontendFolder = await fsMkdtemp(path.join(os.tmpdir(), 'ndb-test-frontend-')); await new ReleaseBuilder([ path.join(__dirname, '..', 'front_end'), DEVTOOLS_DIR, path.join(__dirname, '..'), path.join(__dirname, '..', '..', '..') ], frontendFolder).buildApp('integration_test_runner'); state.frontendFolder = frontendFolder; });
// Start listening Promise.fromNode(cb => { api.listen(config.LANDO_API_PORT, cb); }) // Load our routes .then(() => { fs.readdirSync(path.join(__dirname, 'routes')).map(file => { require(`./routes/${file}`)(api, handler, {config, slack}); log.info('Loaded route %s', file); }); log.info('Listening on port: %s', config.LANDO_API_PORT); });
tape("configAbsoluteSync", (test) => { test.plan(1); const actual = markdownlint.readConfigSync( path.join(__dirname, "config", "config-child.json")); const expected = require("./config/config-child.json"); test.deepEqual(actual, expected, "Config object not correct."); test.end(); });
app.get('/playground/files', catchErrors(async (req, res) => { this.cubejsServer.event('Dev Server Files Load'); const files = await this.cubejsServer.repository.dataSchemaFiles(); res.json({ files: files.map(f => ({ ...f, absPath: path.resolve(path.join(this.cubejsServer.repository.localPath(), f.fileName)) })) }); }));
it('should read timing data', function* () { let json = readJson(path.join(baseDir, `run/agent_timing_${process.pid}.json`)); assert(json.length === 41); assert(json[1].name === 'Application Start'); assert(json[0].pid === process.pid); json = readJson(path.join(baseDir, `run/application_timing_${process.pid}.json`)); assert(json.length === 63); assert(json[1].name === 'Application Start'); assert(json[0].pid === process.pid); });
pkg() { // TODO(ak239spb): implement it as decorations over package.json file. try { return require(path.join(fileURLToPath(this._info.cwd), 'package.json')); } catch (e) { return null; } }
// Retrieve theme override (hotswitch) ipc.once("getThemeOverride", (e, theme) => { if (theme !== null) { window.settings.theme = theme; window.settings.nointroOverride = true; _loadTheme(require(path.join(themesDir, window.settings.theme+".json"))); } else { _loadTheme(require(path.join(themesDir, window.settings.theme+".json"))); } });
tape("styleFiles", (test) => { test.plan(4); fs.readdir("./style", function readdir(err, files) { test.ifError(err); files.forEach(function forFile(file) { test.ok(require(path.join("../style", file)), "Unable to load/parse."); }); test.end(); }); });
async function getFiles(baseSrc) { return glob(path.join(baseSrc, "/**"), { onlyFiles: true, dot: true, ignore: ["**/node_modules/**", "**/.zero/**"] }); }
async getFiles(dir, fileList = []) { const files = await fs.readdir(path.join(this.localPath(), dir)); // eslint-disable-next-line no-restricted-syntax for (const file of files) { const stat = await fs.stat(path.join(this.localPath(), dir, file)); if (stat.isDirectory()) { fileList = await this.getFiles(path.join(dir, file), fileList); } else fileList.push(path.join(dir, file)); } return fileList; }
task() { return replace({ files: path.join(__dirname, '..', 'package.json'), from: /\,\s*\"cleanup.*cleanup\.js\"/, to: '' }); }
async function getFiles(baseSrc) { return glob(path.join(baseSrc, "/**"), { onlyFiles: true, dot: true, ignore: ["**/node_modules/**", "**/.zero/**"] }); }
async function getFiles(baseSrc) { return glob(path.join(baseSrc, "/**"), { onlyFiles: true, ignore: ["node_modules/**", ".zero/**"] }); }