background-step-modules.test.js 643 B

123456789101112131415161718192021
  1. const test = require('node:test');
  2. const assert = require('node:assert/strict');
  3. const fs = require('node:fs');
  4. test('background imports step 1~9 modules', () => {
  5. const source = fs.readFileSync('background.js', 'utf8');
  6. [
  7. 'background/steps/step1.js',
  8. 'background/steps/step2.js',
  9. 'background/steps/step3.js',
  10. 'background/steps/step4.js',
  11. 'background/steps/step5.js',
  12. 'background/steps/step6.js',
  13. 'background/steps/step7.js',
  14. 'background/steps/step8.js',
  15. 'background/steps/step9.js',
  16. ].forEach((path) => {
  17. assert.match(source, new RegExp(path.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')));
  18. });
  19. });