Skip to content

Commit fc36d99

Browse files
author
naman-contentstack
committed
chore: fix failing test cases in export
1 parent f14bac7 commit fc36d99

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

  • packages/contentstack-export/test/unit/export/modules

packages/contentstack-export/test/unit/export/modules/stack.test.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -482,18 +482,16 @@ describe('ExportStack', () => {
482482
description: 'Settings description',
483483
settings: { global: { example: 'value' } },
484484
};
485+
const expectedSettings = { ...settingsData, am_v2: { linked_workspaces: [] as any[] } };
485486
mockStackClient.settings = sinon.stub().resolves(settingsData);
486487

487488
const result = await exportStack.exportStackSettings();
488489

489-
expect(writeFileStub.called).to.be.true;
490-
expect(makeDirectoryStub.called).to.be.true;
491-
// Should return the settings data
492-
expect(result).to.deep.equal(settingsData);
493-
// Verify file was written with correct path
494-
const writeCall = writeFileStub.getCall(0);
490+
expect(result).to.deep.equal(expectedSettings);
491+
const writeCall = writeFileStub.firstCall;
495492
expect(writeCall.args[0]).to.include('settings.json');
496-
expect(writeCall.args[1]).to.deep.equal(settingsData);
493+
expect(writeCall.args[1]).to.deep.equal(expectedSettings);
494+
expect(makeDirectoryStub.firstCall).to.not.be.null;
497495
});
498496

499497
it('should handle errors when exporting settings without throwing', async () => {

0 commit comments

Comments
 (0)