()
| 4 | import { describe, expect, it } from 'vitest'; |
| 5 | |
| 6 | function loadTransColorApp() { |
| 7 | const source = fs.readFileSync(path.resolve('apps/trans-color/index.js'), 'utf8'); |
| 8 | let options; |
| 9 | |
| 10 | vm.runInNewContext(source, { |
| 11 | Vue: function Vue(config) { |
| 12 | options = config; |
| 13 | }, |
| 14 | chrome: { |
| 15 | runtime: { |
| 16 | sendMessage: () => {} |
| 17 | } |
| 18 | }, |
| 19 | document: { |
| 20 | createElement: () => ({ textContent: '' }), |
| 21 | head: { appendChild: () => {} } |
| 22 | }, |
| 23 | console |
| 24 | }); |
| 25 | |
| 26 | const app = JSON.parse(JSON.stringify(options.data)); |
| 27 | Object.keys(options.methods).forEach(methodName => { |
| 28 | app[methodName] = options.methods[methodName].bind(app); |
| 29 | }); |
| 30 | |
| 31 | return app; |
| 32 | } |
| 33 | |
| 34 | describe('trans-color HEX input regression guards', () => { |
| 35 | it('does not normalize the actively edited HEX input on every keypress', () => { |
no test coverage detected