1- // import fs from 'node:fs';
21import os from 'node:os' ;
3- // import { assert, expect } from 'chai';
4- // import sinon from 'sinon';
52
63import { FileStateStore } from './file-state-store' ;
7- // import type { StateStore } from './interface';
84import { StateStoreChaiTestRunner } from './spec-utils' ;
95
106const testRunner = new StateStoreChaiTestRunner ( {
@@ -13,33 +9,3 @@ const testRunner = new StateStoreChaiTestRunner({
139 } ) ,
1410} ) ;
1511testRunner . enableTests ( 'FileStateStore' ) ;
16-
17- // describe('FileStateStore specifics', () => {
18- // const stateStore: StateStore = new FileStateStore({
19- // baseDir: os.tmpdir(),
20- // });
21- // const installUrlOptions = { scopes: ['channels:read'] };
22-
23- // it('should close all files after writing them', async () => {
24- // const writeFileSyncStub = sinon.stub(fs, 'writeFileSync').throws(new Error('mock_write_error'));
25-
26- // try {
27- // await stateStore.generateStateParam(installUrlOptions, new Date());
28- // assert.fail('Exception should be thrown');
29- // // biome-ignore lint/suspicious/noExplicitAny: errors can be anything
30- // } catch (e: any) {
31- // assert.equal(e.message, 'mock_write_error');
32- // }
33-
34- // assert(writeFileSyncStub.calledOnce, 'writeFileSync should be called once');
35- // const fd = writeFileSyncStub.getCall(0).args[0] as number;
36-
37- // expect(
38- // () => fs.fstatSync(fd),
39- // 'The file must be closed, we expect fstatSync to throw an error when the file is closed',
40- // ).to.throw('EBADF: bad file descriptor, fstat');
41-
42- // // Restore original function
43- // writeFileSyncStub.restore();
44- // });
45- // });
0 commit comments