UNPKG

1.47 kBJavaScriptView Raw
1const Project = require('../classes/project');
2const assert = require('assert');
3const chai = require("chai");
4const sinon = require("sinon");
5const sinonChai = require("sinon-chai");
6const path = require('path');
7
8chai.use(sinonChai);
9
10Promise = require('bluebird').Promise;
11
12describe('project', function () {
13
14 it('should initialize', function () {
15 let myProject = new Project(path.join(__dirname, 'mocks'));
16 assert.ok(myProject);
17 });
18
19 it('should have the correct variables', function () {
20 let myProject = new Project(path.join(__dirname, 'mocks'));
21 let projPath = myProject.projectPath;
22 assert.equal(projPath, path.join(__dirname, 'mocks'));
23 assert.equal(myProject.packagePath, path.join(projPath, 'package.json'));
24 assert.equal(myProject.configPath, path.join(projPath, 'config.js'));
25 });
26
27 it('should find that the project is not a glad project', function () {
28 let myProject = new Project(path.join(__dirname, 'mocks'));
29 assert.equal(myProject.isProject(), false);
30 });
31
32 it('should find that the project is a glad project', function () {
33 let myProject = new Project(path.join(__dirname, 'mock-app'));
34 assert.equal(myProject.isProject(), true);
35 });
36
37 it('should initialize', function () {
38 let myProject = new Project(path.join(__dirname, 'mock-app'));
39 myProject.initialize();
40 assert.equal(myProject.orm, 'mongoose');
41 assert.ok(myProject.config.host);
42 });
43
44});