node-fs-extra/lib/fs/__tests__/realpath.test.js
Ryan Zimmerman 3c3865cad8
BREAKING: Drop old Node support (#751)
* BREAKING: Drop old Node support, require v10+

Update CI configs

* Remove references and test fencing for old Node versions

* Use object spread properties

* Use octal literal notation

* Use optional catch bindings
2020-02-04 17:30:40 -05:00

30 lines
637 B
JavaScript

'use strict'
const fse = require('../..')
const assert = require('assert')
/* eslint-env mocha */
describe('realpath.native', () => {
it('works with callbacks', () => {
fse.realpath.native(__dirname, (err, path) => {
assert.ifError(err)
assert.strictEqual(path, __dirname)
})
})
it('works with promises', (done) => {
fse.realpath.native(__dirname)
.then(path => {
assert.strictEqual(path, __dirname)
done()
})
.catch(done)
})
it('works with sync version', () => {
const path = fse.realpathSync.native(__dirname)
assert.strictEqual(path, __dirname)
})
})