test: update fs spec to import fs module instead of shim

This commit is contained in:
Ben Heidemann 2021-04-03 18:02:50 +01:00
parent 5857f1a65f
commit 1ee9f1fde4
1 changed files with 6 additions and 4 deletions

View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
const expect = require('chai').expect; const expect = require('chai').expect;
const utils = require('../../lib/test-utils'); const utils = require('../../lib/test-utils');
const fs = utils.shimIndexedDB(() => require('../../../shims/fs').default); import fs from 'fs';
describe('fs shim', () => { describe('fs shim', () => {
it('should be defined', () => { it('should be defined', () => {
@ -17,10 +17,12 @@ describe('fs shim', () => {
}); });
it('should call callback when calling fs.writeFile', (done) => { it('should call callback when calling fs.writeFile', (done) => {
fs.writeFile('/test.txt', 'test', function(err) { utils.shimIndexedDB(() => {
if(err) throw err; fs.writeFile('/test.txt', 'test', function(err) {
if(err) throw err;
done(); done();
});
}); });
}); });