[ci] yarn format
This commit is contained in:
parent
5601efa257
commit
7fdb7ceca6
2 changed files with 13 additions and 12 deletions
|
@ -5,8 +5,7 @@ import type { TemplateNode } from '@astrojs/parser';
|
|||
export default function (opts: TransformOptions): Transformer {
|
||||
let head: TemplateNode;
|
||||
let hasComponents = false;
|
||||
let isHmrEnabled = typeof opts.compileOptions.hmrPort !== 'undefined' &&
|
||||
opts.compileOptions.mode === 'development';
|
||||
let isHmrEnabled = typeof opts.compileOptions.hmrPort !== 'undefined' && opts.compileOptions.mode === 'development';
|
||||
|
||||
return {
|
||||
visitors: {
|
||||
|
|
|
@ -49,17 +49,19 @@ Basics('Selector with an empty body', async ({ runtime }) => {
|
|||
});
|
||||
|
||||
Basics('Build does not include HMR client', async ({ build, readFile }) => {
|
||||
await build().catch(err => {
|
||||
assert.ok(!err, 'Error during the build');
|
||||
});
|
||||
const clientHTML = await readFile('/client/index.html');
|
||||
const $ = doc(clientHTML);
|
||||
await build().catch((err) => {
|
||||
assert.ok(!err, 'Error during the build');
|
||||
});
|
||||
const clientHTML = await readFile('/client/index.html');
|
||||
const $ = doc(clientHTML);
|
||||
|
||||
assert.equal($('script[src="/_snowpack/hmr-client.js"]').length, 0, 'No HMR client script');
|
||||
const hmrPortScript = $('script').filter((i, el) => {
|
||||
return $(el).text().match(/window\.HMR_WEBSOCKET_PORT/);
|
||||
});
|
||||
assert.equal(hmrPortScript.length, 0, 'No script setting the websocket port');
|
||||
assert.equal($('script[src="/_snowpack/hmr-client.js"]').length, 0, 'No HMR client script');
|
||||
const hmrPortScript = $('script').filter((i, el) => {
|
||||
return $(el)
|
||||
.text()
|
||||
.match(/window\.HMR_WEBSOCKET_PORT/);
|
||||
});
|
||||
assert.equal(hmrPortScript.length, 0, 'No script setting the websocket port');
|
||||
});
|
||||
|
||||
Basics.run();
|
||||
|
|
Loading…
Reference in a new issue