UNPKG

2.19 kBJavaScriptView Raw
1const assert = require('assert')
2const ensurePath = require('../../src/ensure-path')
3const erase = require('../../src/erase')
4const wrote = require('../../src/')
5const read = require('../../src/read')
6const readDir = require('../../src/read-dir')
7const write = require('../../src/write')
8const readDirStructure = require('../../src/read-dir-structure')
9const createWritable = require('../../src/create-writable')
10const clone = require('../../src/clone')
11const exists = require('../../src/exists')
12const assertExists = require('../../src/assert-exists')
13const assertDoesNotExist = require('../../src/assert-does-not-exist')
14const readJSON = require('../../src/read-json')
15const writeJSON = require('../../src/write-json')
16const api = require('../../')
17
18const apiTestSuite = {
19 '0.1.0 should export wrote': () => {
20 assert.strictEqual(api, wrote)
21 },
22 '0.2.0 should export erase': () => {
23 assert.strictEqual(api.erase, erase)
24 },
25 '0.3.0 should export write': () => {
26 assert.strictEqual(api.write, write)
27 },
28 '0.4.0 should export ensurePath': () => {
29 assert.strictEqual(api.ensurePath, ensurePath)
30 },
31 '0.5.0 should export read': () => {
32 assert.strictEqual(api.read, read)
33 },
34 '0.6.0 should export readDir': () => {
35 assert.strictEqual(api.readDir, readDir)
36 },
37 '0.7.0 should export readDirStructure': () => {
38 assert.strictEqual(api.readDirStructure, readDirStructure)
39 },
40 '1.0.0 should export an object and createWritable instead of wrote'() {
41 assert(typeof api === 'object')
42 assert.strictEqual(api.createWritable, createWritable)
43 },
44 '1.1.0 should export clone'() {
45 assert.strictEqual(api.clone, clone)
46 },
47 '1.2.0 should export exists, assertExists, assertDoesNotExist'() {
48 assert.strictEqual(api.exists, exists)
49 assert.strictEqual(api.assertExists, assertExists)
50 assert.strictEqual(api.assertDoesNotExist, assertDoesNotExist)
51 },
52 '1.3.0 should export readJSON, writeJSON'() {
53 assert.strictEqual(api.readJSON, readJSON)
54 assert.strictEqual(api.writeJSON, writeJSON)
55 },
56}
57
58module.exports = apiTestSuite