Merge pull request #12003 from backstage/fix/techdocs-windows-build

[TechDocs] Fix failing windows test
This commit is contained in:
Eric Peterson
2022-06-13 18:03:50 +02:00
committed by GitHub
3 changed files with 8 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-techdocs-node': patch
---
Updated deprecated use of `express`' `res.redirect()` method when handling legacy path casing.
@@ -24,6 +24,7 @@ import request from 'supertest';
import mockFs from 'mock-fs';
import * as os from 'os';
import { LocalPublish } from './local';
import path from 'path';
const createMockEntity = (annotations = {}, lowerCase = false) => {
return {
@@ -145,7 +146,7 @@ describe('local publisher', () => {
...{
kind: 'component',
metadata: {
name: '../component/other-component',
name: path.join('..', 'component', 'other-component'),
namespace: 'default',
},
},
@@ -220,7 +220,7 @@ export class LocalPublish implements PublisherBase {
}
// Otherwise, redirect to the new path.
return res.redirect(req.baseUrl + newPath, 301);
return res.redirect(301, req.baseUrl + newPath);
});
router.use(