-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed absolute path config bug and improved workspace related specs (#82
) * fixed absolute path config bug and improved workspace related specs * fix specs and bump coverage * validate final workspace choice
- Loading branch information
1 parent
344319d
commit 3cd967a
Showing
8 changed files
with
99 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...cases/build.config.error-workspace-absolute/build.config.error-workspace-absolute.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Use Case | ||
* Run Greenwood build command with a bad value for workspace directory (that doesn't exist) in a custom config. | ||
* | ||
* User Result | ||
* Should throw an error. | ||
* | ||
* User Command | ||
* greenwood build | ||
* | ||
* User Config | ||
* { | ||
* workspace: path.join(__dirname, 'noop') | ||
* } | ||
* | ||
* User Workspace | ||
* Greenwood default | ||
*/ | ||
const expect = require('chai').expect; | ||
const TestBed = require('../../test-bed'); | ||
|
||
describe('Build Greenwood With: ', () => { | ||
let setup; | ||
|
||
before(async () => { | ||
setup = new TestBed(); | ||
setup.setupTestBed(__dirname); | ||
}); | ||
|
||
describe('Custom Configuration with a bad value (absolute path) for Workspace', () => { | ||
it('should throw an error that workspace path must exist', async () => { | ||
try { | ||
await setup.runGreenwoodCommand('build'); | ||
} catch (err) { | ||
expect(err).to.contain('greenwood.config.js workspace doesn\'t exist!'); | ||
} | ||
}); | ||
}); | ||
|
||
after(function() { | ||
setup.teardownTestBed(); | ||
}); | ||
|
||
}); |
5 changes: 5 additions & 0 deletions
5
test/cli/cases/build.config.error-workspace-absolute/greenwood.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
workspace: path.join(__dirname, 'noop') | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
3 changes: 3 additions & 0 deletions
3
test/cli/cases/build.config.workspace-custom/www/pages/about.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
### Nested Custom About Page | ||
|
||
This is a custom about page built by Greenwood. |
3 changes: 3 additions & 0 deletions
3
test/cli/cases/build.config.workspace-custom/www/pages/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
### Greenwood | ||
|
||
This is the home page built by Greenwood. Make your own pages in src/pages/index.js! |