-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.config.default.spec.js
48 lines (43 loc) · 1.22 KB
/
build.config.default.spec.js
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
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* Use Case
* Run Greenwood with empty config object and default workspace.
*
* User Result
* Should generate a bare bones Greenwood build. (same as build.default.spec.js)
*
* User Command
* greenwood build
*
* User Config
* {}
*
* User Workspace
* Greenwood default (src/)
*/
import path from 'path';
import { runSmokeTest } from '../../../../../test/smoke-test.js';
import { getSetupFiles, getOutputTeardownFiles } from '../../../../../test/utils.js';
import { Runner } from 'gallinago';
import { fileURLToPath, URL } from 'url';
describe('Build Greenwood With: ', function() {
const LABEL = 'Empty Configuration and Default Workspace';
const cliPath = path.join(process.cwd(), 'packages/cli/src/index.js');
const outputPath = fileURLToPath(new URL('.', import.meta.url));
let runner;
before(function() {
this.context = {
publicDir: path.join(outputPath, 'public')
};
runner = new Runner();
});
describe(LABEL, function() {
before(function() {
runner.setup(outputPath, getSetupFiles(outputPath));
runner.runCommand(cliPath, 'build');
});
runSmokeTest(['public', 'index'], LABEL);
});
after(function() {
runner.teardown(getOutputTeardownFiles(outputPath));
});
});