chore(TypeScript): remove mock-fs

This commit is contained in:
harttle
2019-02-17 21:37:13 +08:00
parent aa49b4f117
commit f432aade6a
11 changed files with 57 additions and 57 deletions
+3 -5
View File
@@ -1,8 +1,8 @@
import { expect } from 'chai'
import * as request from 'supertest'
import * as express from 'express'
import * as mock from 'mock-fs'
import Liquid from '../../dist/liquid.common.js'
import { mock, restore } from 'test/stub/mockfs'
import Liquid from '../..'
describe('express()', function () {
var app, engine
@@ -24,9 +24,7 @@ describe('express()', function () {
file: req.params.file
}))
})
after(function () {
mock.restore()
})
after(restore)
it('should render express views', function (done) {
mock({ '/views/name.html': 'My name is {{name}}.' })
app.set('views', ['/views'])
+3 -7
View File
@@ -1,6 +1,6 @@
import { expect } from 'chai'
import * as mock from 'mock-fs'
import Liquid from '../..'
import { mock, restore } from '../stub/mockfs'
describe('#renderFile()', function () {
var engine
@@ -13,14 +13,10 @@ describe('#renderFile()', function () {
'/root/files/bar': 'bar',
'/root/files/foo.html': 'foo',
'/root/files/name.html': 'My name is {{name}}.',
'/un-readable.html': mock.file({
mode: '0000'
})
'/un-readable.html': { mode: '0000' }
})
})
afterEach(function () {
mock.restore()
})
afterEach(restore)
it('should render file', async function () {
const html = await engine.renderFile('/root/files/foo.html', {})
return expect(html).to.equal('foo')