c9-core/plugins/c9.vfs.server/vfs_wrapper_test.js

40 wiersze
1.0 KiB
JavaScript
Czysty Zwykły widok Historia

2016-06-26 11:53:19 +00:00
#!/usr/bin/env node
/*global describe it before after beforeEach afterEach */
"use strict";
"use server";
require("c9/inline-mocha")(module);
var assert = require("assert-diff");
var path = require("path");
var vfs = require("vfs-local");
var vfsWrapper = require("./vfs_wrapper");
2017-01-30 11:32:54 +00:00
describe(__filename, function() {
2016-06-26 11:53:19 +00:00
describe("#extend", function() {
var wrapper;
beforeEach(function() {
var home = vfs({
root: path.normalize(__dirname + "/.."),
testing: true,
2017-12-13 20:17:16 +00:00
nopty: true
2016-06-26 11:53:19 +00:00
});
wrapper = vfsWrapper(home, {
root: __dirname
});
});
it("should return an error if file is not passed", function(done) {
2017-01-30 11:32:54 +00:00
wrapper.extend('foo', { file: {}, encoding: "utf8" }, function(err, data) {
2016-06-26 11:53:19 +00:00
assert(err);
assert.equal(err.message, "Invalid option 'file'");
done();
});
});
});
});