diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 1fe5d5102e5..65a1bfb4104 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -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: diff --git a/conf/tsconfig.test.json b/conf/tsconfig.test.json index 0aa1ba1d290..20529dc4da9 100644 --- a/conf/tsconfig.test.json +++ b/conf/tsconfig.test.json @@ -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" ] diff --git a/package.json b/package.json index 2203f916744..c854aee9e60 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/test/source/thunderbird-manifest-v2-test.ts b/test/source/thunderbird-manifest-v2-test.ts new file mode 100644 index 00000000000..f17b3417bbc --- /dev/null +++ b/test/source/thunderbird-manifest-v2-test.ts @@ -0,0 +1,26 @@ +/* ©️ 2016 - present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com */ +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();