-
-
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.
- Loading branch information
Showing
10 changed files
with
50 additions
and
6 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import tap from 'tap' | ||
import desm from 'desm' | ||
import { Siteup } from '../../index.js' | ||
import * as path from 'path' | ||
import rimraf from 'rimraf' | ||
import { promisify } from 'util' | ||
|
||
const __dirname = desm(import.meta.url) | ||
const rimrafP = promisify(rimraf) | ||
|
||
tap.test('build-errors', async (t) => { | ||
const src = path.join(__dirname, './src') | ||
const dest = path.join(__dirname, './public') | ||
const cwd = __dirname | ||
const siteUp = new Siteup(src, dest, cwd) | ||
|
||
await rimrafP(dest) | ||
|
||
try { | ||
const results = await siteUp.build() | ||
t.notOk(results, 'Build should fail, and not generate results') | ||
} catch (err) { | ||
t.match(err.message, /Build finished but there were errors/, 'Should have an error message about a filed build.') | ||
t.ok(Array.isArray(err.errors), 'Should have an array of errors') | ||
|
||
const pageError = err.errors.find(err => err.message.includes('Error building page')) | ||
|
||
t.ok(pageError, 'Should include a page build error') | ||
t.ok(pageError.cause, 'Should include an error cause') | ||
} | ||
}) |
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 @@ | ||
README.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 @@ | ||
# A working page | ||
|
||
Just some working markdown |
File renamed without changes.
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 @@ | ||
console.log('hi') |
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,7 @@ | ||
export default () => /* html */` | ||
<div>Hello this is a JS page</div> | ||
` | ||
|
||
// Some garbled JS syntax | ||
// eslint-disable-next-line | ||
fdsf dsf fdsaf; |
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 @@ | ||
.some-class { | ||
background: blue; | ||
} |