background-step-modules.test.js 774 B

12345678910111213141516171819202122
  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. ].forEach((path) => {
  18. assert.match(source, new RegExp(path.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')));
  19. });
  20. });