summaryrefslogtreecommitdiffstats
path: root/lib/fs/__tests__/mock.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-09-05 11:04:18 +0200
committerSamy Pessé <samypesse@gmail.com>2016-09-05 11:04:18 +0200
commita14ca3e268e95a7eab59fb205b41da7331d57631 (patch)
tree9c84b2cbd561345335fca3e26af961b2ea23d8ec /lib/fs/__tests__/mock.js
parent9c071dade573aa6990878006f83c89b6065a1395 (diff)
downloadgitbook-a14ca3e268e95a7eab59fb205b41da7331d57631.zip
gitbook-a14ca3e268e95a7eab59fb205b41da7331d57631.tar.gz
gitbook-a14ca3e268e95a7eab59fb205b41da7331d57631.tar.bz2
Switch to lerna
Diffstat (limited to 'lib/fs/__tests__/mock.js')
-rw-r--r--lib/fs/__tests__/mock.js82
1 files changed, 0 insertions, 82 deletions
diff --git a/lib/fs/__tests__/mock.js b/lib/fs/__tests__/mock.js
deleted file mode 100644
index 04bd46a..0000000
--- a/lib/fs/__tests__/mock.js
+++ /dev/null
@@ -1,82 +0,0 @@
-var createMockFS = require('../mock');
-
-describe('MockFS', function() {
- var fs = createMockFS({
- 'README.md': 'Hello World',
- 'SUMMARY.md': '# Summary',
- 'folder': {
- 'test.md': 'Cool',
- 'folder2': {
- 'hello.md': 'Hello',
- 'world.md': 'World'
- }
- }
- });
-
- describe('exists', function() {
- it('must return true for a file', function() {
- return fs.exists('README.md')
- .then(function(result) {
- expect(result).toBeTruthy();
- });
- });
-
- it('must return false for a non existing file', function() {
- return fs.exists('README_NOTEXISTS.md')
- .then(function(result) {
- expect(result).toBeFalsy();
- });
- });
-
- it('must return true for a directory', function() {
- return fs.exists('folder')
- .then(function(result) {
- expect(result).toBeTruthy();
- });
- });
-
- it('must return true for a deep file', function() {
- return fs.exists('folder/test.md')
- .then(function(result) {
- expect(result).toBeTruthy();
- });
- });
-
- it('must return true for a deep file (2)', function() {
- return fs.exists('folder/folder2/hello.md')
- .then(function(result) {
- expect(result).toBeTruthy();
- });
- });
- });
-
- describe('readAsString', function() {
- it('must return content for a file', function() {
- return fs.readAsString('README.md')
- .then(function(result) {
- expect(result).toBe('Hello World');
- });
- });
-
- it('must return content for a deep file', function() {
- return fs.readAsString('folder/test.md')
- .then(function(result) {
- expect(result).toBe('Cool');
- });
- });
- });
-
- describe('readDir', function() {
- it('must return content for a directory', function() {
- return fs.readDir('./')
- .then(function(files) {
- expect(files.size).toBe(3);
- expect(files.includes('README.md')).toBeTruthy();
- expect(files.includes('SUMMARY.md')).toBeTruthy();
- expect(files.includes('folder/')).toBeTruthy();
- });
- });
- });
-});
-
-