Skip to content

Commit

Permalink
Test for #148
Browse files Browse the repository at this point in the history
  • Loading branch information
trieloff committed Sep 6, 2018
1 parent 7656544 commit 5d12069
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/fixtures/broken.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
- strain:
name: no-default
code: /hlx/default/git-github-com-adobe-helix-cli-git--dirty--
index: README.html
url: https://www.example.com/
content:
repo: helix-cli
ref: master
owner: adobe
- strain:
name: e7fab6e2b493b75a
code: /hlx/default/git-github-com-adobe-helix-cli-git--dirty--
index: index.html
content:
repo: helix-cli
ref: implement-init
owner: adobe
18 changes: 18 additions & 0 deletions test/testStrainCmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,22 @@ describe('hlx strain (Integration)', () => {
done();
}).catch(done);
}).timeout(10000);

it('Invalid strains.yaml gets rejected', () => {
const brokenstrains = path.resolve(__dirname, 'fixtures/broken.yaml');

try {
new StrainCommand()
.withStrainFile(brokenstrains)
.withDryRun(true)
.withFastlyAuth(FASTLY_AUTH)
.withFastlyNamespace('GM98lH4M9g5l4LvdWlqK0')
.withWskHost('runtime.adobe.io')
.withWskAuth(WSK_AUTH)
.withWskNamespace('trieloff');
assert.fail('Broken strains should be rejected.');
} catch (e) {
assert.ok(e.message);
}
});
});

0 comments on commit 5d12069

Please sign in to comment.