background-step-modules.test.js 726 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/open-chatgpt.js',
  8. 'background/steps/submit-signup-email.js',
  9. 'background/steps/fill-password.js',
  10. 'background/steps/fetch-signup-code.js',
  11. 'background/steps/fill-profile.js',
  12. 'background/steps/oauth-login.js',
  13. 'background/steps/fetch-login-code.js',
  14. 'background/steps/confirm-oauth.js',
  15. 'background/steps/platform-verify.js',
  16. ].forEach((path) => {
  17. assert.match(source, new RegExp(path.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')));
  18. });
  19. });