Skip to content

Commit

Permalink
Refactor test fs-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
JPeer264 committed Feb 21, 2017
1 parent 9fc96fd commit 1269845
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions lib/__tests__/fs-integration.test.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
var assert = require('assert')
var path = require('path')
var os = require('os')
var fs = require('fs')
var fse = require('../')
'use strict'

const os = require('os')
const fs = require('fs')
const fse = require('../')
const path = require('path')
const assert = require('assert')

/* global afterEach, beforeEach, describe, it */

describe('native fs', function () {
describe('native fs', () => {
var TEST_DIR

beforeEach(function (done) {
beforeEach(done => {
TEST_DIR = path.join(os.tmpdir(), 'fs-extra', 'native-fs')
fse.emptyDir(TEST_DIR, done)
})

afterEach(function (done) {
afterEach(done => {
fse.remove(TEST_DIR, done)
})

it('should use native fs methods', function () {
it('should use native fs methods', () => {
var file = path.join(TEST_DIR, 'write.txt')
fse.writeFileSync(file, 'hello')
var data = fse.readFileSync(file, 'utf8')
assert.equal(data, 'hello')
})

it('should have native fs constants', function () {
it('should have native fs constants', () => {
// Node.js v0.12 / IO.js
if ('F_OK' in fs) {
assert.equal(fse.F_OK, fs.F_OK)
Expand Down

0 comments on commit 1269845

Please sign in to comment.