Repository: streamich/memfs
Pull request #15 (2017-08-15 23:44:31)

reme


Patch:
diff --git a/.travis.yml b/.travis.yml
index de0e70ae..dabdacc0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,6 @@
 sudo: false
 os:
   - linux
-  - osx
 language: node_js
 node_js:
   - '8'
diff --git a/README.md b/README.md
index c364ada1..531093fe 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# memfs 2.0 [![][npm-img]][npm-url]
+# memfs 2.0 [![][npm-badge]][npm-url] [![][travis-badge]][travis-url]
 
 In-memory file-system with [Node's `fs` API](https://nodejs.org/api/fs.html).
 
@@ -34,11 +34,12 @@ Create a file system from a plain JSON:
 ```js
 import {fs, vol} from 'memfs';
 
-vol.importJSON({
+const json = {
     './README.md': '1',
     './src/index.js': '2',
     './node_modules/debug/index.js': '3',
-}, '/app');
+};
+vol.importJSON(json, '/app');
 
 fs.readFileSync('/app/README.md', 'utf8'); // 1
 vol.readFileSync('/app/src/index.js', 'utf8'): // 2
@@ -62,6 +63,7 @@ expect(vol.toJSON()).to.eql({"/foo": "bar"});
 
 Other filesystem goodies:
 
+ - [`spyfs`][linkfs] - spies on filesystem actions
  - [`unionfs`][unionfs] - creates a union of multiple filesystem volumes
  - [`linkfs`][linkfs] - redirects filesystem paths
  - [`fs-monkey`][fs-monkey] - monkey-patches Node's `fs` module and `require` function
@@ -322,10 +324,13 @@ implemented (you have access to any file), basically `fs.access()` is a no-op.
 
 
 [npm-url]: https://www.npmjs.com/package/memfs
-[npm-img]: https://img.shields.io/npm/v/memfs.svg
+[npm-badge]: https://img.shields.io/npm/v/memfs.svg
+[travis-url]: https://travis-ci.org/streamich/memfs
+[travis-badge]: https://travis-ci.org/streamich/memfs.svg?branch=master
 [memfs]: https://github.com/streamich/memfs
 [unionfs]: https://github.com/streamich/unionfs
 [linkfs]: https://github.com/streamich/linkfs
+[spyfs]: https://github.com/streamich/spyfs
 [fs-monkey]: https://github.com/streamich/fs-monkey
 
 
diff --git a/package.json b/package.json
index 3fa615ca..d7139c86 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "memfs",
-  "version": "2.0.9",
+  "version": "2.0.10",
   "description": "In-memory file-system with Node's fs API.",
   "main": "lib/index.js",
   "keywords": [
@@ -73,10 +73,10 @@
     "build-ts": "gulp build-ts",
     "build-js": "babel src --out-dir lib",
     "test": "npm run test-basic-js",
-    "test-basic-js": "mocha lib/**/*.test.js",
-    "test-basic-ts": "mocha --require ts-node/register src/**/*.test.ts",
-    "test-watch-ts": "mocha --require ts-node/register src/**/*.test.ts --watch",
-    "test-coverage-ts": "nyc --per-file mocha --require ts-node/register --require source-map-support/register --full-trace --bail src/**/*.test.ts",
+    "test-basic-js": "mocha lib/**/**/**/*.test.js",
+    "test-basic-ts": "mocha --require ts-node/register src/**/**/**/*.test.ts",
+    "test-watch-ts": "mocha --require ts-node/register src/**/**/**/*.test.ts --watch",
+    "test-coverage-ts": "nyc --per-file mocha --require ts-node/register --require source-map-support/register --full-trace --bail src/**/**/**/*.test.ts",
     "watch": "watch 'npm run build' ./src"
   }
 }


Test patch:
diff --git a/lib/test/openSync.test.js b/lib/test/openSync.test.js
new file mode 100644
index 00000000..bddfdd20
--- /dev/null
+++ b/lib/test/openSync.test.js
@@ -0,0 +1,10 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var __1 = require("..");
+var chai_1 = require("chai");
+describe('openSync(path, mode[, flags])', function () {
+    it('should return a file descriptor', function () {
+        var fd = __1.fs.openSync('/foo', 'w');
+        chai_1.expect(typeof fd).to.equal('number');
+    });
+});
diff --git a/src/test/openSync.test.ts b/src/test/openSync.test.ts
new file mode 100644
index 00000000..dc1f3210
--- /dev/null
+++ b/src/test/openSync.test.ts
@@ -0,0 +1,10 @@
+import {fs} from '..';
+import {expect} from 'chai';
+
+
+describe('openSync(path, mode[, flags])', () => {
+    it('should return a file descriptor', () => {
+        const fd = fs.openSync('/foo', 'w');
+        expect(typeof fd).to.equal('number');
+    });
+});
\ No newline at end of file