fix tests

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2023-07-31 15:27:03 +02:00
parent c186c631b4
commit b0e3b6c074
6 changed files with 19 additions and 12 deletions
@@ -14,7 +14,10 @@
* limitations under the License.
*/
jest.mock('./helpers');
jest.mock('@backstage/plugin-scaffolder-node', () => {
const actual = jest.requireActual('@backstage/plugin-scaffolder-node');
return { ...actual, fetchContents: jest.fn() };
});
import os from 'os';
import { resolve as resolvePath } from 'path';
@@ -14,7 +14,10 @@
* limitations under the License.
*/
jest.mock('./helpers');
jest.mock('@backstage/plugin-scaffolder-node', () => {
const actual = jest.requireActual('@backstage/plugin-scaffolder-node');
return { ...actual, fetchFile: jest.fn() };
});
import os from 'os';
import { resolve as resolvePath } from 'path';
@@ -14,6 +14,11 @@
* limitations under the License.
*/
jest.mock('@backstage/plugin-scaffolder-node', () => {
const actual = jest.requireActual('@backstage/plugin-scaffolder-node');
return { ...actual, fetchContents: jest.fn() };
});
import os from 'os';
import { join as joinPath, sep as pathSep } from 'path';
import fs from 'fs-extra';
@@ -32,10 +37,6 @@ import {
TemplateAction,
} from '@backstage/plugin-scaffolder-node';
jest.mock('./helpers', () => ({
fetchContents: jest.fn(),
}));
type FetchTemplateInput = ReturnType<
typeof createFetchTemplateAction
> extends TemplateAction<infer U>