Skip to content

Commit 2a0f09e

Browse files
fix: update schema handling in content types and field rules tests
1 parent 22c0a0c commit 2a0f09e

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

packages/contentstack-audit/test/unit/modules/content-types.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ describe('Content types', () => {
152152
.stub(cliux, 'confirm', async () => true)
153153
.it('should not write the file', async () => {
154154
const ctInstance = new ContentType({ ...constructorParam, fix: true });
155+
(ctInstance as any).schema = constructorParam.ctSchema?.length ? [constructorParam.ctSchema[0]] : [];
155156
const fsSpy = sinon.spy(fs, 'writeFileSync');
156157
await ctInstance.writeFixContent();
157158
expect(fsSpy.callCount).to.be.equals(1);

packages/contentstack-audit/test/unit/modules/field-rules.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ describe('Field Rules', () => {
147147
.stub(cliux, 'confirm', async () => true)
148148
.it('should not write the file', async () => {
149149
const ctInstance = new FieldRule({ ...constructorParam, fix: true });
150+
(ctInstance as any).schema = constructorParam.ctSchema?.length ? [constructorParam.ctSchema[0]] : [];
150151
const fsSpy = sinon.spy(fs, 'writeFileSync');
151152
await ctInstance.writeFixContent();
152153
expect(fsSpy.callCount).to.be.equals(1);

0 commit comments

Comments
 (0)