You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all,
I am in the process of replacing mock-fs with mem-fs due to its lack of support for node 20.X. I am struggling to get mem-fs working in this simple case:
Here the original test case with mock-fs:
it('should use local hosts if they exist', async () => {
mockFs({
'admin/exchange-hosts.yaml': mockFs.load('test/unit/input-files/exchange-hosts.yaml'),
'exchange-config': mockFs.load('test/unit/input-files/gateway/exchange-config-integration')
});
await validateHostsByEnvironment({ exchangeConfigPath: 'exchange-config', env: Environment.production, validation });
expect(validation.errors).to.be.empty;
expect(validation.warnings).to.be.empty;
expect(validation.info).to.contain('[prod/real.yaml] Hosts authorised');
expect(getExchangeHostsRawStub.notCalled).to.be.true;
});
and here the refactored one with mem-fs that does not work:
it('should use local hosts if they exist', async () => {
vol.fromNestedJSON({
'admin/exchange-hosts.yaml': ufs.readFileSync('test/unit/input-files/exchange-hosts.yaml'),
'exchange-config': await loadIntoMockFS('test/unit/input-files/gateway/exchange-config-integration'),
}, appPath);
await validateHostsByEnvironment({ exchangeConfigPath: 'exchange-config', env: Environment.production, validation });
expect(validation.errors).to.be.empty;
expect(validation.warnings).to.be.empty;
expect(validation.info).to.contain('[prod/real.yaml] Hosts authorised');
expect(getExchangeHostsRawStub.notCalled).to.be.true;
});
I am not sure I actually need the loadIntoMockFS method at all. The test fail since the folder exchange-config cannot be found (but if I print vol.tree I can definitely see it).
I am sure I am missing something stupid here :)
The text was updated successfully, but these errors were encountered:
Hi all,
I am in the process of replacing mock-fs with mem-fs due to its lack of support for node 20.X. I am struggling to get mem-fs working in this simple case:
Here the original test case with mock-fs:
and here the refactored one with mem-fs that does not work:
the method loadIntoMockFS is here:
I am not sure I actually need the
loadIntoMockFS
method at all. The test fail since the folderexchange-config
cannot be found (but if I print vol.tree I can definitely see it).I am sure I am missing something stupid here :)
The text was updated successfully, but these errors were encountered: