fix(core): update
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import * as smartfile from '../ts/index';
|
||||
import path = require('path');
|
||||
import * as path from 'path';
|
||||
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
|
||||
@ -8,7 +8,9 @@ import { expect, tap } from '@pushrocks/tapbundle';
|
||||
// ---------------------------
|
||||
|
||||
tap.test('.fs.fileExistsSync -> should return an accurate boolean', async () => {
|
||||
// tslint:disable-next-line: no-unused-expression
|
||||
expect(smartfile.fs.fileExistsSync('./test/testassets/mytest.json')).to.be.true;
|
||||
// tslint:disable-next-line: no-unused-expression
|
||||
expect(smartfile.fs.fileExistsSync('./test/testassets/notthere.json')).be.false;
|
||||
});
|
||||
|
||||
|
15
test/test.virtualdirectory.ts
Normal file
15
test/test.virtualdirectory.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import { tap, expect } from '@pushrocks/tapbundle';
|
||||
|
||||
import * as smartfile from '../ts';
|
||||
|
||||
tap.test('should create a virtualdirectory', async () => {
|
||||
const virtualDir = await smartfile.VirtualDirectory.fromFsDirPath('./test/testassets/testfolder');
|
||||
expect(virtualDir.smartfileArray.length).to.equal(4);
|
||||
});
|
||||
|
||||
tap.test('should write to a directory', async () => {
|
||||
const virtualDir = await smartfile.VirtualDirectory.fromFsDirPath('./test/testassets/testfolder');
|
||||
virtualDir.saveToDisk('./test/testassets/test');
|
||||
});
|
||||
|
||||
tap.start();
|
Reference in New Issue
Block a user