Merge pull request #19565 from backstage/rugvip/1820

Switch to Node.js v18 + v20
This commit is contained in:
Patrik Oldsberg
2023-09-20 15:02:14 +02:00
committed by GitHub
45 changed files with 154 additions and 106 deletions
+1 -1
View File
@@ -69,7 +69,7 @@
"@backstage/cli": "workspace:^",
"@backstage/types": "workspace:^",
"@types/supertest": "^2.0.8",
"mock-fs": "^5.1.0",
"mock-fs": "^5.2.0",
"msw": "^1.0.0",
"node-fetch": "^2.6.7",
"supertest": "^6.1.3"
@@ -45,7 +45,7 @@
"@types/command-exists": "^1.2.0",
"@types/fs-extra": "^9.0.1",
"@types/mock-fs": "^4.13.0",
"mock-fs": "^5.1.0",
"mock-fs": "^5.2.0",
"msw": "^1.0.0"
},
"files": [
@@ -43,9 +43,9 @@
"@types/command-exists": "^1.2.0",
"@types/fs-extra": "^9.0.1",
"@types/mock-fs": "^4.13.0",
"@types/node": "^16.11.26",
"@types/node": "^18.17.8",
"jest-when": "^3.1.0",
"mock-fs": "^5.1.0"
"mock-fs": "^5.2.0"
},
"files": [
"dist"
+1 -1
View File
@@ -113,7 +113,7 @@
"@types/zen-observable": "^0.8.0",
"esbuild": "^0.19.0",
"jest-when": "^3.1.0",
"mock-fs": "^5.1.0",
"mock-fs": "^5.2.0",
"msw": "^1.0.0",
"supertest": "^6.1.3",
"wait-for-expect": "^3.0.2",
@@ -85,8 +85,8 @@ describe('fs:rename examples', () => {
const sourceFilePath = resolvePath(workspacePath, sourceFile);
const destFilePath = resolvePath(workspacePath, destFile);
const sourceBeforeContent = fs.readFileSync(sourceFilePath, 'utf-8');
const destBeforeContent = fs.readFileSync(destFilePath, 'utf-8');
const sourceBeforeContent = await fs.readFile(sourceFilePath, 'utf-8');
const destBeforeContent = await fs.readFile(destFilePath, 'utf-8');
expect(sourceBeforeContent).not.toEqual(destBeforeContent);
@@ -97,7 +97,7 @@ describe('fs:rename examples', () => {
},
});
const destAfterContent = fs.readFileSync(destFilePath, 'utf-8');
const destAfterContent = await fs.readFile(destFilePath, 'utf-8');
expect(sourceBeforeContent).toEqual(destAfterContent);
});
@@ -148,7 +148,7 @@ describe('fs:rename', () => {
it('should throw is trying to override by mistake', async () => {
const destFile = 'unit-test-c.js';
const filePath = resolvePath(workspacePath, destFile);
const beforeContent = fs.readFileSync(filePath, 'utf-8');
const beforeContent = await fs.readFile(filePath, 'utf-8');
await expect(
action.handler({
@@ -164,7 +164,7 @@ describe('fs:rename', () => {
}),
).rejects.toThrow(/dest already exists/);
const afterContent = fs.readFileSync(filePath, 'utf-8');
const afterContent = await fs.readFile(filePath, 'utf-8');
expect(beforeContent).toEqual(afterContent);
});
@@ -191,8 +191,8 @@ describe('fs:rename', () => {
const sourceFilePath = resolvePath(workspacePath, sourceFile);
const destFilePath = resolvePath(workspacePath, destFile);
const sourceBeforeContent = fs.readFileSync(sourceFilePath, 'utf-8');
const destBeforeContent = fs.readFileSync(destFilePath, 'utf-8');
const sourceBeforeContent = await fs.readFile(sourceFilePath, 'utf-8');
const destBeforeContent = await fs.readFile(destFilePath, 'utf-8');
expect(sourceBeforeContent).not.toEqual(destBeforeContent);
@@ -209,7 +209,7 @@ describe('fs:rename', () => {
},
});
const destAfterContent = fs.readFileSync(destFilePath, 'utf-8');
const destAfterContent = await fs.readFile(destFilePath, 'utf-8');
expect(sourceBeforeContent).toEqual(destAfterContent);
});
+1 -1
View File
@@ -63,7 +63,7 @@
"js-yaml": "^4.0.0",
"json5": "^2.1.3",
"mime-types": "^2.1.27",
"mock-fs": "^5.1.0",
"mock-fs": "^5.2.0",
"p-limit": "^3.1.0",
"recursive-readdir": "^2.2.2",
"winston": "^3.2.1"
@@ -393,7 +393,7 @@ describe('helpers', () => {
await patchIndexPreBuild({ inputDir: '/', logger: mockLogger });
expect(fs.readFileSync('/docs/index.md', 'utf-8')).toEqual(
await expect(fs.readFile('/docs/index.md', 'utf-8')).resolves.toEqual(
'index.md content',
);
expect(warn).not.toHaveBeenCalledWith();
@@ -407,7 +407,7 @@ describe('helpers', () => {
await patchIndexPreBuild({ inputDir: '/', logger: mockLogger });
expect(fs.readFileSync('/docs/index.md', 'utf-8')).toEqual(
await expect(fs.readFile('/docs/index.md', 'utf-8')).resolves.toEqual(
'docs/README.md content',
);
expect(warn.mock.calls).toEqual([
@@ -422,7 +422,7 @@ describe('helpers', () => {
await patchIndexPreBuild({ inputDir: '/', logger: mockLogger });
expect(fs.readFileSync('/docs/index.md', 'utf-8')).toEqual(
await expect(fs.readFile('/docs/index.md', 'utf-8')).resolves.toEqual(
'main README.md content',
);
expect(warn.mock.calls).toEqual([
@@ -437,7 +437,7 @@ describe('helpers', () => {
await patchIndexPreBuild({ inputDir: '/', logger: mockLogger });
expect(() => fs.readFileSync('/docs/index.md', 'utf-8')).toThrow();
await expect(fs.readFile('/docs/index.md', 'utf-8')).rejects.toThrow();
const paths = [
path.normalize('docs/index.md'),
path.normalize('docs/README.md'),
@@ -483,7 +483,7 @@ describe('helpers', () => {
await expect(
createOrUpdateMetadata(filePath, mockLogger),
).rejects.toThrow('Unexpected token d in JSON at position 0');
).rejects.toThrow('Unexpected token');
});
it('should add build timestamp to the metadata json', async () => {
@@ -520,7 +520,7 @@ describe('helpers', () => {
const filePath = path.join(rootDir, 'invalid_techdocs_metadata.json');
await expect(storeEtagMetadata(filePath, 'etag123abc')).rejects.toThrow(
'Unexpected token d in JSON at position 0',
'Unexpected token',
);
});