forked from CleverStack/cleverstack-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.test.js
More file actions
35 lines (31 loc) · 1.38 KB
/
setup.test.js
File metadata and controls
35 lines (31 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var chai = require( 'chai' )
, expect = chai.expect
, exec = require('child_process').exec
, path = require( 'path' )
, rimraf = require( 'rimraf' )
, async = require( 'async' )
, fs = require( 'fs' )
, binPath = path.join( __dirname, '..', 'bin' )
, assetPath = path.join( __dirname, 'assets' );
chai.Assertion.includeStack = true;
describe( 'Setup', function ( ) {
after( function ( done ) {
rimraf( path.join( assetPath, 'my-new-project' ), function ( ) {
done( );
} );
} );
before( function ( done ) {
async.parallel( [
async.apply( rimraf, path.join( assetPath, 'my-new-project', 'backend', 'node_modules', 'memcached' ) ),
async.apply( rimraf, path.join( assetPath, 'my-new-project', 'frontend', 'app', 'components', 'datatables' ) )
], done );
} );
it( 'should be able to setup a new environment', function ( done ) {
exec( path.join( binPath, 'clever-setup --skip-protractor' ), { cwd: path.join( assetPath, 'my-new-project' ) }, function ( err, stdout, stderr ) {
expect( stderr ).to.equal( '' );
expect( fs.existsSync( path.join( assetPath, 'my-new-project', 'backend', 'node_modules', 'memcached' ) ) ).to.be.true;
expect( fs.existsSync( path.join( assetPath, 'my-new-project', 'frontend', 'app', 'components', 'datatables' ) ) ).to.be.true;
done( err );
} );
} );
} );