Skip to content

Commit 3047b08

Browse files
authored
Allow FEED_ID_JSON in makeStub (#812)
1 parent a7751dd commit 3047b08

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/main.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,4 @@ jobs:
9494
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9595
EXTERNAL_ADAPTER_GENERATOR_NO_INTERACTIVE: 'true'
9696
EXTERNAL_ADAPTER_GENERATOR_STANDALONE: 'true'
97+
EXTERNAL_ADAPTER_GENERATOR_USE_LOCAL_FRAMEWORK_VERSION: 'true'

scripts/generator-adapter/generators/app/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export default class extends Generator.default {
5656
// with the same content in the same directory and extend from it. Also, new packages and config files (jest, babel) will be added
5757
// to be able to run the tests
5858
standalone = process.env.EXTERNAL_ADAPTER_GENERATOR_STANDALONE === 'true'
59+
useLocalFrameworkVersion = process.env.EXTERNAL_ADAPTER_GENERATOR_USE_LOCAL_FRAMEWORK_VERSION === 'true'
5960

6061
constructor(args, opts) {
6162
super(args, opts, { customInstallTask: true })
@@ -96,11 +97,12 @@ export default class extends Generator.default {
9697
const endpointNames = Object.values(endpoints).map(e => e.normalizedEndpointName).join(', ')
9798

9899
const includeComments = await this._promptConfirmation(adapterName, endpointNames)
100+
const frameworkVersion = this.useLocalFrameworkVersion
101+
? 'file:../../dist/src'
102+
: (await require('../../../package.json')).version
99103

100104
this.props = {
101-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
102-
// @ts-ignore
103-
frameworkVersion: (await require('../../../package.json')).version,
105+
frameworkVersion,
104106
adapterName,
105107
endpoints,
106108
endpointNames,

src/util/testing-utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ export const allowedUndefinedStubProps = [
602602
'toJSON',
603603
'asymmetricMatch',
604604
'then',
605+
'FEED_ID_JSON',
605606
]
606607

607608
const isStubPropAllowedUndefined = (prop: string | symbol) => {

0 commit comments

Comments
 (0)