Use `chai` instead of `must`

As of 1.10, chai supports nonary assertions, there are no more reasons
for using a different variant.
This commit is contained in:
Miroslav Bajtoš 2014-11-13 15:31:35 +01:00
parent 6040f66adc
commit e2aff71bf9
4 changed files with 11 additions and 12 deletions

View File

@ -32,15 +32,14 @@
"underscore": "^1.6.0"
},
"devDependencies": {
"browserify": "^6.1.0",
"fs-extra": "^0.12.0",
"browserify": "^4.1.8",
"chai": "^1.10.0",
"coffee-script": "^1.8.0",
"coffeeify": "^0.7.0",
"fs-extra": "^0.12.0",
"jshint": "^2.5.6",
"loopback": "^2.5.0",
"mocha": "^1.19.0",
"must": "^0.12.0",
"supertest": "^0.14.0"
}
}

View File

@ -1,7 +1,7 @@
var boot = require('../');
var fs = require('fs');
var path = require('path');
var expect = require('must');
var expect = require('chai').expect;
var browserify = require('browserify');
var sandbox = require('./helpers/sandbox');
var vm = require('vm');
@ -91,7 +91,7 @@ function browserifyTestApp(appDir, strategy, next) {
var bundlePath = sandbox.resolve('browser-app-bundle.js');
var out = fs.createWriteStream(bundlePath);
b.bundle().pipe(out);
out.on('error', function(err) { return next(err); });
out.on('close', function() {
next(null, bundlePath);

View File

@ -1,7 +1,7 @@
var boot = require('../');
var fs = require('fs-extra');
var path = require('path');
var expect = require('must');
var expect = require('chai').expect;
var sandbox = require('./helpers/sandbox');
var appdir = require('./helpers/appdir');
@ -379,7 +379,7 @@ describe('compiler', function() {
var instructions = boot.compile(appdir.PATH);
expect(instructions.files.boot).to.eql([initJs]);
});
it('supports `bootDirs` option', function() {
appdir.createConfigFilesSync();
var initJs = appdir.writeFileSync('custom-boot/init.js',
@ -390,7 +390,7 @@ describe('compiler', function() {
});
expect(instructions.files.boot).to.eql([initJs]);
});
it('supports `bootScripts` option', function() {
appdir.createConfigFilesSync();
var initJs = appdir.writeFileSync('custom-boot/init.js',
@ -475,19 +475,19 @@ describe('compiler', function() {
sourceFile: path.resolve(appdir.PATH, 'models', 'car.coffee')
});
});
it('supports `modelSources` option', function() {
appdir.createConfigFilesSync({}, {}, {
Car: { dataSource: 'db' }
});
appdir.writeConfigFileSync('custom-models/car.json', { name: 'Car' });
appdir.writeFileSync('custom-models/car.js', '');
var instructions = boot.compile({
appRootDir: appdir.PATH,
modelSources: ['./custom-models']
});
expect(instructions.models).to.have.length(1);
expect(instructions.models[0]).to.eql({
name: 'Car',

View File

@ -2,7 +2,7 @@ var boot = require('../');
var path = require('path');
var loopback = require('loopback');
var assert = require('assert');
var expect = require('must');
var expect = require('chai').expect;
var fs = require('fs-extra');
var sandbox = require('./helpers/sandbox');
var appdir = require('./helpers/appdir');