mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
23 lines
624 B
JavaScript
23 lines
624 B
JavaScript
'use strict'
|
|
|
|
const path = require('path')
|
|
const chai = require('chai')
|
|
const fileExists = require('../../../../../lib/utils/fs/file-exists')
|
|
|
|
// Configure chai
|
|
chai.use(require('chai-as-promised'))
|
|
chai.use(require('sinon-chai'))
|
|
const expect = require('chai').expect
|
|
|
|
describe('#fileExists()', () => {
|
|
describe('When reading a file', () => {
|
|
it('should detect if a file exists', () =>
|
|
expect(fileExists(__filename)).to.eventually.equal(true))
|
|
|
|
it("should detect if a file doesn't exist", () =>
|
|
expect(fileExists(path.join(__dirname, 'XYZ.json'))).to.eventually.equal(
|
|
false,
|
|
))
|
|
})
|
|
})
|