mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 03:05:12 +00:00
emit a basepath event on first run
This commit is contained in:
@@ -133,6 +133,7 @@ function run({ mode, basepath = '' }) {
|
||||
let capture;
|
||||
|
||||
let base;
|
||||
let captured_basepath;
|
||||
|
||||
const nightmare = new Nightmare();
|
||||
|
||||
@@ -179,7 +180,13 @@ function run({ mode, basepath = '' }) {
|
||||
let handler;
|
||||
|
||||
proc.on('message', message => {
|
||||
if (message.__sapper__) return;
|
||||
if (message.__sapper__) {
|
||||
if (message.event === 'basepath') {
|
||||
captured_basepath = basepath;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (handler) handler(message);
|
||||
});
|
||||
|
||||
@@ -597,6 +604,10 @@ function run({ mode, basepath = '' }) {
|
||||
assert.ok(!hasProgressIndicator);
|
||||
});
|
||||
});
|
||||
|
||||
it('emits a basepath', () => {
|
||||
assert.equal(captured_basepath, basepath);
|
||||
});
|
||||
});
|
||||
|
||||
describe('headers', () => {
|
||||
|
||||
Reference in New Issue
Block a user