Skip to content

Commit

Permalink
tweak to module 1 test
Browse files Browse the repository at this point in the history
  • Loading branch information
jonfriskics committed May 21, 2018
1 parent 30a81c5 commit cdaea36
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/unit/mocha/part1/app-vue-will-contain-book-list.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ describe('App.vue', () => {

// Test for correct import statement
const ast = esprima.parse(script[0].childNodes[0].value, { sourceType: 'module' });
let importDeclaration = esquery(ast, 'ImportDeclaration');

assert(importDeclaration.length > 0, "The App component does not contain an import statement");
assert(importDeclaration[0].specifiers[0].local.name == 'BookList', 'App.vue isn\'t importing a class named `BookList`');

let results = esquery(ast, 'ImportDeclaration[source.value="./components/BookList"]');
assert(results.length > 0, '`./components/BookList` was not imported');

Expand Down

0 comments on commit cdaea36

Please sign in to comment.