test fixes for Node.js v20
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -72,11 +72,11 @@ describe('ReadableArrayResponse', () => {
|
||||
const res = new ReadableArrayResponse(arr, '/tmp', 'etag');
|
||||
const dir = await res.dir();
|
||||
|
||||
expect(fs.readFileSync(resolvePath(dir, 'file1.yaml'), 'utf8').trim()).toBe(
|
||||
'site_name: Test',
|
||||
);
|
||||
expect(fs.readFileSync(resolvePath(dir, 'file2.yaml'), 'utf8').trim()).toBe(
|
||||
'site_name: Test2',
|
||||
);
|
||||
await expect(
|
||||
fs.readFile(resolvePath(dir, 'file1.yaml'), 'utf8'),
|
||||
).resolves.toBe('site_name: Test\n');
|
||||
await expect(
|
||||
fs.readFile(resolvePath(dir, 'file2.yaml'), 'utf8'),
|
||||
).resolves.toBe('site_name: Test2\n');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -571,7 +571,7 @@ Please add '/backstageRoot/node_modules' to the 'NODE_PATH' when running the bac
|
||||
"failed to load dynamic plugin manifest from '/backstageRoot/dist-dynamic/test-backend-plugin/alpha'",
|
||||
meta: {
|
||||
name: 'SyntaxError',
|
||||
message: 'Unexpected token i in JSON at position 0',
|
||||
message: expect.stringContaining('Unexpected token'),
|
||||
},
|
||||
},
|
||||
],
|
||||
@@ -604,7 +604,7 @@ Please add '/backstageRoot/node_modules' to the 'NODE_PATH' when running the bac
|
||||
"failed to load dynamic plugin manifest from '/backstageRoot/dist-dynamic/test-backend-plugin'",
|
||||
meta: {
|
||||
name: 'SyntaxError',
|
||||
message: 'Unexpected token i in JSON at position 0',
|
||||
message: expect.stringContaining('Unexpected token'),
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -70,7 +70,7 @@ describe('defaultConfigLoaderSync', () => {
|
||||
anyEnv.APP_CONFIG = [{ data: { my: 'config' }, context: 'a' }];
|
||||
|
||||
expect(() => defaultConfigLoaderSync('}')).toThrow(
|
||||
'Failed to load runtime configuration, SyntaxError: Unexpected token } in JSON at position 0',
|
||||
'Failed to load runtime configuration, SyntaxError: Unexpected token',
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -304,13 +304,13 @@ describe('tasks', () => {
|
||||
},
|
||||
);
|
||||
// catalog was populated with `context.name`
|
||||
expect(
|
||||
fs.readFileSync('templatedApp/catalog-info.yaml', 'utf-8'),
|
||||
).toContain('name: SuperCoolBackstageInstance');
|
||||
await expect(
|
||||
fs.readFile('templatedApp/catalog-info.yaml', 'utf-8'),
|
||||
).resolves.toContain('name: SuperCoolBackstageInstance');
|
||||
// backend dependencies include `sqlite3` from `context.SQLite`
|
||||
expect(
|
||||
fs.readFileSync('templatedApp/packages/backend/package.json', 'utf-8'),
|
||||
).toContain('sqlite3"');
|
||||
await expect(
|
||||
fs.readFile('templatedApp/packages/backend/package.json', 'utf-8'),
|
||||
).resolves.toContain('sqlite3"');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user