background-step-modules.test.js 847 B

123456789101112131415161718192021222324
  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~10 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/clear-login-cookies.js',
  13. 'background/steps/oauth-login.js',
  14. 'background/steps/fetch-login-code.js',
  15. 'background/steps/confirm-oauth.js',
  16. 'background/steps/platform-verify.js',
  17. 'background/cpa-api.js',
  18. 'background/steps/sync-cpa-session.js',
  19. ].forEach((path) => {
  20. assert.match(source, new RegExp(path.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')));
  21. });
  22. });