Files: 1eb144e388da5f1a3466703f56ac4ab591d700fc / test / test-79-npm / v8flags / v8flags.js
669 bytesRaw
1 | /* eslint-disable no-underscore-dangle */ |
2 | |
3 | 'use strict'; |
4 | |
5 | var cp = require('child_process'); |
6 | |
7 | require('module')._extensions['.json'] = function () { |
8 | throw new Error('prevent loading json cache'); |
9 | }; |
10 | |
11 | var execFileCalled = false; |
12 | var execFileSave = cp.execFile; |
13 | |
14 | cp.execFile = function () { |
15 | execFileCalled = true; |
16 | execFileSave.apply(cp, arguments); // eslint-disable-line prefer-rest-params |
17 | }; |
18 | |
19 | setTimeout(function () { |
20 | var v8flags = require('v8flags'); |
21 | v8flags(function (error, results) { |
22 | if (error) return; |
23 | if (!Array.isArray(results)) return; |
24 | if (results.length < 6) return; |
25 | if (!execFileCalled) return; |
26 | console.log('ok'); |
27 | }); |
28 | }, 500); |
29 |
Built with git-ssb-web