-
-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add light mode during development
- Loading branch information
Showing
7 changed files
with
159 additions
and
17 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
<!doctype html><html><head><link rel="icon" href="/assets/favicon.png"></head><body></body></html> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
const test = require('ava'); | ||
const path = require('path'); | ||
const fs = require('fs-extra'); | ||
const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
const FaviconsWebpackPlugin = require('../'); | ||
|
||
const { logo, mkdir, generate, compare, expected } = require('./util'); | ||
|
||
test.beforeEach(async t => t.context.root = await mkdir()); | ||
|
||
test('should work if manual set to light mode', async t => { | ||
const dist = path.join(t.context.root, 'dist'); | ||
await generate({ | ||
context: t.context.root, | ||
output: { | ||
path: dist, | ||
}, | ||
plugins: [ | ||
new HtmlWebpackPlugin(), | ||
new FaviconsWebpackPlugin({ logo, mode: 'light' }), | ||
], | ||
}); | ||
|
||
t.deepEqual(await compare(dist, path.resolve(expected, 'light')), []); | ||
}); | ||
|
||
test('should automatically pick up the dev mode from webpack', async t => { | ||
const dist = path.join(t.context.root, 'dist'); | ||
await generate({ | ||
mode: 'development', | ||
context: t.context.root, | ||
output: { | ||
path: dist, | ||
}, | ||
plugins: [ | ||
new HtmlWebpackPlugin(), | ||
new FaviconsWebpackPlugin({ logo }), | ||
], | ||
}); | ||
|
||
t.deepEqual(await compare(dist, path.resolve(expected, 'light')), []); | ||
}) | ||
|
||
test.afterEach(t => fs.remove(t.context.root)); |