Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor tests copy/copy-sync to ES6 #364

Merged
merged 6 commits into from Feb 21, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 12 additions & 10 deletions lib/__tests__/fs-integration.test.js
@@ -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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this test just for Node v0.12 / IO ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what is meant by that comment, we do need to test fs constants.

if ('F_OK' in fs) {
assert.equal(fse.F_OK, fs.F_OK)
Expand Down