mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 03:05:12 +00:00
use nightmare for testing
This commit is contained in:
@@ -38,10 +38,6 @@ module.exports = function create_watcher() {
|
||||
);
|
||||
});
|
||||
|
||||
watcher = {
|
||||
ready: invalidate()
|
||||
};
|
||||
|
||||
function watch_compiler(type) {
|
||||
const compiler = compilers[type];
|
||||
|
||||
@@ -55,7 +51,7 @@ module.exports = function create_watcher() {
|
||||
deferreds[type].reject(err);
|
||||
});
|
||||
|
||||
compiler.watch({}, (err, stats) => {
|
||||
return compiler.watch({}, (err, stats) => {
|
||||
if (stats.hasErrors()) {
|
||||
deferreds[type].reject(stats.toJson().errors[0]);
|
||||
} else {
|
||||
@@ -64,8 +60,16 @@ module.exports = function create_watcher() {
|
||||
});
|
||||
}
|
||||
|
||||
watch_compiler('client');
|
||||
watch_compiler('server');
|
||||
watcher = {
|
||||
ready: invalidate(),
|
||||
client: watch_compiler('client'),
|
||||
server: watch_compiler('server'),
|
||||
|
||||
close: () => {
|
||||
watcher.client.close();
|
||||
watcher.server.close();
|
||||
}
|
||||
};
|
||||
|
||||
return watcher;
|
||||
};
|
||||
Reference in New Issue
Block a user