(context = {})
| 21 | |
| 22 | describe('dynamic runtime developer support', () => { |
| 23 | function createNativeFunction(context = {}) { |
| 24 | return function (...args) { |
| 25 | const code = String(args.pop() || ''); |
| 26 | const names = args; |
| 27 | return function (...values) { |
| 28 | const sandbox = { console, ...context }; |
| 29 | names.forEach((name, index) => { |
| 30 | sandbox[name] = values[index]; |
| 31 | }); |
| 32 | return vm.runInNewContext(`(function(){${code}\n}).call(this)`, sandbox); |
| 33 | }; |
| 34 | }; |
| 35 | } |
| 36 | |
| 37 | it('dynamic index.html uses external helper scripts instead of inline bootstrap', () => { |
| 38 | const html = fs.readFileSync(path.resolve('apps/dynamic/index.html'), 'utf8'); |
no outgoing calls
no test coverage detected