forked from gatsbyjs/gatsby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a bunch of tests for various plugins (gatsbyjs#1581)
* test: add test scaffolding for plugins * test: add a simple test for navigateTo * test: add a bunch of tests * style: run prettier on tests * test: fix broken absolute url * test: fix equality check * test: (hopefully) fix issue with windows
- Loading branch information
1 parent
ef2fa8c
commit 5202cad
Showing
2 changed files
with
23 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const { sourceNodes } = require(`../gatsby-node`) | ||
|
||
test(`it has a test`, () => {}) |
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,20 @@ | ||
const path = require(`path`) | ||
const { loadNodeContent } = require(`../`) | ||
|
||
describe(`gatsby-source-filesystem`, () => { | ||
it(`can load the content of a file`, async () => { | ||
const content = await loadNodeContent({ | ||
absolutePath: path.join(__dirname, `../index.js`), | ||
}) | ||
|
||
expect(content.length).toBeGreaterThan(0) | ||
}) | ||
|
||
it(`rejects if file not found`, async () => { | ||
await loadNodeContent({ | ||
absolutePath: path.join(__dirname, `haha-not-a-real-file.js`), | ||
}).catch(err => { | ||
expect(err).toBeDefined() | ||
}) | ||
}) | ||
}) |