test: update fs spec to import fs module instead of shim
This commit is contained in:
parent
5857f1a65f
commit
1ee9f1fde4
|
@ -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,12 +17,14 @@ describe('fs shim', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should call callback when calling fs.writeFile', (done) => {
|
it('should call callback when calling fs.writeFile', (done) => {
|
||||||
|
utils.shimIndexedDB(() => {
|
||||||
fs.writeFile('/test.txt', 'test', function(err) {
|
fs.writeFile('/test.txt', 'test', function(err) {
|
||||||
if(err) throw err;
|
if(err) throw err;
|
||||||
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('should return an object when accessing fs.promises', () => {
|
it('should return an object when accessing fs.promises', () => {
|
||||||
expect(typeof fs.promises).to.equal('object');
|
expect(typeof fs.promises).to.equal('object');
|
||||||
|
|
Loading…
Reference in New Issue