[ci] yarn format

This commit is contained in:
matthewp 2021-06-16 17:38:46 +00:00 committed by GitHub Actions
parent 5601efa257
commit 7fdb7ceca6
2 changed files with 13 additions and 12 deletions

View file

@ -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: {

View file

@ -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();