Skip to content

Commit 31a3e7b

Browse files
authored
update incorrect comment change for-loop (#413)
* update incorrect comment change for-loop * don't close test browser if it never started * prettier * empty commit
1 parent ab0b02a commit 31a3e7b

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

scripts/e2e.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function openUrl(url, ...options) {
4040
}
4141

4242
// Simplest form of opening
43-
openUrl('https://minimalcss.app/').then(spawned => {
43+
openUrl('https://minimalcss.app/').then((spawned) => {
4444
const css = spawned.stdout.toString();
4545
assert(
4646
css.length > 7000 && css.length < 10000,
@@ -50,7 +50,7 @@ openUrl('https://minimalcss.app/').then(spawned => {
5050

5151
// Open with -o
5252
openUrl('https://developer.mozilla.org/', '-o', '/tmp/mdn.css').then(
53-
spawned => {
53+
(spawned) => {
5454
const stdout = spawned.stdout.toString();
5555
assert(!stdout.trim(), 'Output should be empty');
5656
const css = fs.readFileSync('/tmp/mdn.css').toString();
@@ -62,7 +62,7 @@ openUrl('https://developer.mozilla.org/', '-o', '/tmp/mdn.css').then(
6262
);
6363

6464
// With verbose output
65-
openUrl('https://developer.mozilla.org/', '--verbose').then(spawned => {
65+
openUrl('https://developer.mozilla.org/', '--verbose').then((spawned) => {
6666
const css = spawned.stdout.toString();
6767
assert(/\/\*\nGenerated /.test(css), 'Expected verbose leading comment');
6868
assert(

src/run.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -448,9 +448,7 @@ const minimalcss = async (options) => {
448448
const skippedUrls = new Set();
449449

450450
try {
451-
// Note! This opens one URL at a time synchronous
452-
for (let i = 0; i < urls.length; i++) {
453-
const pageUrl = urls[i];
451+
for (const pageUrl of urls) {
454452
const page = await browser.newPage();
455453
if (!enableServiceWorkers) {
456454
await page._client.send('ServiceWorker.disable');

tests/main.test.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ beforeAll(async () => {
4141

4242
afterAll(async () => {
4343
await fastify.close();
44-
await browser.close();
44+
if (browser) {
45+
await browser.close();
46+
}
4547
});
4648

4749
test('handles relative paths', async () => {

0 commit comments

Comments
 (0)