mirror of
https://github.com/lawrencehook/remove-youtube-suggestions.git
synced 2026-07-31 17:30:47 +00:00
8825666512
Add RYS Premium subscription system Introduce optional paid tier with sign-in, Stripe billing, and premium feature gating. Core features remain free. Includes Node.js server for auth, payments, and license management. Extension changes: - Sign-in flow with magic link email - Premium/upgrade/account modals with branded UI - Premium feature gating (60+ advanced settings) - Password lock and scheduling (premium) - Fix "hide all but first row" for YouTube's new flat homepage DOM - Hide sidebar ad panels by default - Enable "Hide all Shorts" by default Server: - Magic link auth with rate limiting - Stripe checkout, webhooks, and billing portal - JWT-based license tokens - AWS SES transactional emails (welcome, sign-in, cancellation) - Grandfathered donor support Also adds CI workflow, server test suite, and extension unit tests.
38 lines
1.0 KiB
JavaScript
38 lines
1.0 KiB
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
// Set up test environment variables
|
|
process.env.JWT_SECRET = 'test-secret-key-for-testing-only-32chars';
|
|
process.env.STRIPE_SECRET_KEY = 'sk_test_fake';
|
|
process.env.STRIPE_PRICE_MONTHLY = 'price_test_monthly';
|
|
process.env.STRIPE_PRICE_YEARLY = 'price_test_yearly';
|
|
process.env.STRIPE_WEBHOOK_SECRET = 'whsec_test';
|
|
process.env.EMAIL_FROM = 'test@example.com';
|
|
process.env.BASE_URL = 'http://localhost:3000';
|
|
process.env.DATA_DIR = './tests/test-data';
|
|
|
|
// Clean up test data directory
|
|
const testDataDir = './tests/test-data';
|
|
|
|
function cleanTestData() {
|
|
try {
|
|
if (fs.existsSync(testDataDir)) {
|
|
fs.rmSync(testDataDir, { recursive: true, force: true });
|
|
}
|
|
} catch (err) {
|
|
// Ignore ENOTEMPTY errors from race conditions in parallel tests
|
|
if (err.code !== 'ENOTEMPTY' && err.code !== 'ENOENT') {
|
|
throw err;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Clean before tests
|
|
cleanTestData();
|
|
|
|
// Export for use in tests
|
|
module.exports = {
|
|
cleanTestData,
|
|
testDataDir,
|
|
};
|