Skip to content

Commit c2a1c05

Browse files
committed
Increase timeout for build:all test
1 parent e3aa9b3 commit c2a1c05

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

lib/buildtools/src/build/manifest.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,35 @@ import manifestSchema from './modules/manifest.schema.json' with { type: 'json'
1212
* Checks that the given bundle manifest was correctly specified
1313
*/
1414
export async function getBundleManifest(manifestFile: string, tabCheck?: boolean): Promise<BundleManifest | undefined> {
15-
let rawManifest: string;
15+
let manifestStr: string;
1616

1717
try {
18-
rawManifest = await fs.readFile(manifestFile, 'utf-8');
18+
manifestStr = await fs.readFile(manifestFile, 'utf-8');
1919
} catch (error) {
2020
if (isNodeError(error) && error.code === 'ENOENT') {
2121
return undefined;
2222
}
2323
throw error;
2424
}
2525

26-
const data = JSON.parse(rawManifest) as BundleManifest;
27-
validate(data, manifestSchema, { throwError: true });
26+
const rawManifest = JSON.parse(manifestStr) as BundleManifest;
27+
validate(rawManifest, manifestSchema, { throwError: true });
28+
29+
const manifest = {
30+
...rawManifest,
31+
tabs: !rawManifest.tabs ? rawManifest.tabs : rawManifest.tabs.map(each => each.trim()),
32+
};
2833

2934
// Make sure that all the tabs specified exist
30-
if (tabCheck && data.tabs) {
35+
if (tabCheck && manifest.tabs) {
3136
const tabsDir = await getTabsDir();
32-
await Promise.all(data.tabs.map(async tabName => {
37+
await Promise.all(manifest.tabs.map(async tabName => {
3338
const resolvedTab = await resolveSingleTab(`${tabsDir}/${tabName}`);
3439
if (resolvedTab === undefined) throw new Error(`Failed to find tab with name '${tabName}'!`);
3540
}));
3641
}
3742

38-
return data;
43+
return manifest;
3944
}
4045

4146
/**

lib/buildtools/src/build/modules/manifest.schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
},
1212
"version": {
1313
"type": "string",
14-
"description": "Version of your bundle"
14+
"description": "Version of your bundle",
15+
"pattern": "^[0-9]+(\\.[0-9]){0,2}$"
1516
},
1617
"requires": {
1718
"enum": [1, 2, 3, 4],

lib/buildtools/src/commands/__tests__/buildAll.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const mockedTsc = vi.spyOn(tsc, 'runTsc').mockImplementation(input => Promise.re
5454
describe('Test build:all command', () => {
5555
const runCommand = getCommandRunner(getBuildAllCommand);
5656

57-
test('Regular command execution', async () => {
57+
test('Regular command execution', { timeout: 10000 }, async () => {
5858
await expect(runCommand()).commandSuccess();
5959

6060
// Two bundles, so two calls to buildBundle

0 commit comments

Comments
 (0)