+5
-2
@@ -16,8 +16,6 @@
|
||||
|
||||
import yaml from 'yaml';
|
||||
|
||||
jest.mock('./helpers');
|
||||
|
||||
import os from 'os';
|
||||
import { resolve as resolvePath } from 'path';
|
||||
import { getVoidLogger, UrlReader } from '@backstage/backend-common';
|
||||
@@ -28,6 +26,11 @@ import { PassThrough } from 'stream';
|
||||
import { fetchContents } from '@backstage/plugin-scaffolder-node';
|
||||
import { examples } from './plain.examples';
|
||||
|
||||
jest.mock('@backstage/plugin-scaffolder-node', () => ({
|
||||
...jest.requireActual('@backstage/plugin-scaffolder-node'),
|
||||
fetchContents: jest.fn(),
|
||||
}));
|
||||
|
||||
describe('fetch:plain examples', () => {
|
||||
const integrations = ScmIntegrations.fromConfig(
|
||||
new ConfigReader({
|
||||
|
||||
+5
-3
@@ -15,9 +15,6 @@
|
||||
*/
|
||||
|
||||
import yaml from 'yaml';
|
||||
|
||||
jest.mock('./helpers');
|
||||
|
||||
import os from 'os';
|
||||
import { resolve as resolvePath } from 'path';
|
||||
import { getVoidLogger, UrlReader } from '@backstage/backend-common';
|
||||
@@ -28,6 +25,11 @@ import { PassThrough } from 'stream';
|
||||
import { fetchFile } from '@backstage/plugin-scaffolder-node';
|
||||
import { examples } from './plainFile.examples';
|
||||
|
||||
jest.mock('@backstage/plugin-scaffolder-node', () => ({
|
||||
...jest.requireActual('@backstage/plugin-scaffolder-node'),
|
||||
fetchContents: jest.fn(),
|
||||
}));
|
||||
|
||||
describe('fetch:plain:file examples', () => {
|
||||
const integrations = ScmIntegrations.fromConfig(
|
||||
new ConfigReader({
|
||||
|
||||
+3
-2
@@ -25,16 +25,17 @@ import {
|
||||
} from '@backstage/backend-common';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
import { PassThrough } from 'stream';
|
||||
import { fetchContents } from '@backstage/plugin-scaffolder-node';
|
||||
import { createFetchTemplateAction } from './template';
|
||||
import {
|
||||
ActionContext,
|
||||
TemplateAction,
|
||||
fetchContents,
|
||||
} from '@backstage/plugin-scaffolder-node';
|
||||
import { examples } from './template.examples';
|
||||
import yaml from 'yaml';
|
||||
|
||||
jest.mock('./helpers', () => ({
|
||||
jest.mock('@backstage/plugin-scaffolder-node', () => ({
|
||||
...jest.requireActual('@backstage/plugin-scaffolder-node'),
|
||||
fetchContents: jest.fn(),
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user