Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

# 5786 Added basic test for Thunderbird port #5851

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ blocks:
- name: enterprise mock - standard test group
commands:
- npm run-script test_ci_chrome_enterprise
- name: thunderbird test
commands:
- npm run-script test_thunderbird
epilogue:
always:
commands:
Expand Down
1 change: 1 addition & 0 deletions conf/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"../extension/types/node-forge.d.ts",
"../test/source/test.ts",
"../test/source/patterns.ts",
"../test/source/thunderbird-manifest-v2-test.ts",
"../test/source/async-stack.ts",
"../test/source/buf.ts"
]
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"test_eslint": "export NODE_OPTIONS=\"--max-old-space-size=4096\"; eslint .",
"test_eslint_ci": "npm run test_eslint -- --format @microsoft/eslint-formatter-sarif --output-file eslint-results.sarif",
"test_patterns": "node build/test/test/source/patterns.js",
"test_thunderbird": "npm run pretest && node build/test/test/source/thunderbird-manifest-v2-test.js",
"test_async_stack": "node build/test/test/source/async-stack.js",
"test_buf": "npx ava --timeout=3m --verbose --concurrency=10 build/test/test/source/buf.js",
"test_ci_chrome_consumer_live_gmail": "npx ava --timeout=45m --verbose --tap --concurrency=1 build/test/test/source/test.js -- CONSUMER-LIVE-GMAIL STANDARD-GROUP | npx tap-xunit > report.xml",
Expand Down
26 changes: 26 additions & 0 deletions test/source/thunderbird-manifest-v2-test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* ©️ 2016 - present FlowCrypt a.s. Limitations apply. Contact [email protected] */
import * as fs from 'fs';

/* This test looks for any unexpected change for Thunderbird port of FlowCrypt ensuring its using Manifest v2 */

const manifestPath = 'build/thunderbird-consumer/manifest.json';
const manifestContent = fs.readFileSync(manifestPath, 'utf8');
const manifest = JSON.parse(manifestContent);

const testManifestV2Format = () => {
try {
if (manifest.manifest_version !== 2) {
throw new Error('Manifest version is not 2');
}
if (!Array.isArray(manifest.web_accessible_resources)) {
throw new Error('web_accessible_resources should be an array');
}
if (typeof manifest.content_security_policy !== 'string') {
throw new Error('content_security_policy should be a string');
}
} catch (error) {
console.error('Manifest V2 format test failed:', error.message);
}
};

testManifestV2Format();
Loading