+2
-2
@@ -33,8 +33,8 @@ const executeShellCommand = jest.fn();
|
||||
const commandExists = jest.fn();
|
||||
const fetchContents = jest.fn();
|
||||
|
||||
jest.mock('@backstage/plugin-scaffolder-backend', () => ({
|
||||
...jest.requireActual('@backstage/plugin-scaffolder-backend'),
|
||||
jest.mock('@backstage/plugin-scaffolder-node', () => ({
|
||||
...jest.requireActual('@backstage/plugin-scaffolder-node'),
|
||||
fetchContents: (...args: any[]) => fetchContents(...args),
|
||||
executeShellCommand: (...args: any[]) => executeShellCommand(...args),
|
||||
}));
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
*/
|
||||
|
||||
const mockRailsTemplater = { run: jest.fn() };
|
||||
jest.mock('@backstage/plugin-scaffolder-backend', () => ({
|
||||
...jest.requireActual('@backstage/plugin-scaffolder-backend'),
|
||||
jest.mock('@backstage/plugin-scaffolder-node', () => ({
|
||||
...jest.requireActual('@backstage/plugin-scaffolder-node'),
|
||||
fetchContents: jest.fn(),
|
||||
}));
|
||||
jest.mock('./railsNewRunner', () => {
|
||||
@@ -39,7 +39,7 @@ import os from 'os';
|
||||
import { resolve as resolvePath } from 'path';
|
||||
import { PassThrough } from 'stream';
|
||||
import { createFetchRailsAction } from './index';
|
||||
import { fetchContents } from '@backstage/plugin-scaffolder-backend';
|
||||
import { fetchContents } from '@backstage/plugin-scaffolder-node';
|
||||
|
||||
describe('fetch:rails', () => {
|
||||
const integrations = ScmIntegrations.fromConfig(
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
const executeShellCommand = jest.fn();
|
||||
const commandExists = jest.fn();
|
||||
|
||||
jest.mock('@backstage/plugin-scaffolder-backend', () => ({
|
||||
jest.mock('@backstage/plugin-scaffolder-node', () => ({
|
||||
executeShellCommand: (...args: any[]) => executeShellCommand(...args),
|
||||
}));
|
||||
jest.mock(
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user