Skip to content

Commit 49bba04

Browse files
zubhavrschristian
andauthored
fix: remove lint warnings, update tests and rename file (#1691)
* fix silent failing test * remove lint warnings, update tests and rename file * Update packages/cli/tests/build.test.js * Update packages/cli/babel/index.js Co-authored-by: Ryan Christian <33403762+rschristian@users.noreply.github.com>
1 parent 6c6316e commit 49bba04

File tree

7 files changed

+8
-6
lines changed

7 files changed

+8
-6
lines changed

packages/cli/babel/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var defaultBrowserListDev = [
2121
'ios_saf >= 10.3',
2222
'edge >= 16',
2323
'opera >= 48',
24-
'samsung >= 8.2'
24+
'samsung >= 8.2',
2525
];
2626

2727
// preact-cli babel configs
File renamed without changes.

packages/cli/sw/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { registerRoute, setCatchHandler } from 'workbox-routing';
22
import { precacheAndRoute, getCacheKeyForURL } from 'workbox-precaching';
33
import { isNav } from './utils';
4-
import { NETWORK_HANDLER, PRECACHING_OPTIONS } from './contants';
4+
import { NETWORK_HANDLER, PRECACHING_OPTIONS } from './constants';
55

66
export function getFiles() {
77
return self.__WB_MANIFEST;

packages/cli/tests/build.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,10 @@ describe('preact build', () => {
182182
`${dir}/build/${bundleFile}`,
183183
'utf8'
184184
);
185+
185186
// "Hello World!" should replace 'process.env.PREACT_APP_MY_VARIABLE'
186-
expect(transpiledChunk.includes('console.log("Hello World!")')).toBe(true);
187+
expect(transpiledChunk.includes('"Hello World!"')).toBe(true);
188+
expect(transpiledChunk.includes('PREACT_APP_MY_VARIABLE')).toBe(false);
187189
});
188190

189191
it('should respect `publicPath` value', async () => {

packages/cli/tests/lib/chrome.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports.waitUntilExpression = async function (page, expression) {
1212
`Waiting for ${expression}`
1313
);
1414

15-
return result; // && result.value;
15+
return result;
1616
};
1717

1818
await waitUntil(evaluate, `Waiting for ${expression} timed out!`);

packages/cli/tests/lib/output.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ async function tmpDir() {
1010
let str = Math.random()
1111
.toString(36)
1212
.replace(/[^a-z]+/g, '')
13-
.substr(0, 12);
13+
.substring(0, 12);
1414
await mkdir(output, { recursive: true });
1515
return resolve(output, str);
1616
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
console.log(process.env.PREACT_APP_MY_VARIABLE);
1+
export const MY_VARIABLE = process.env.PREACT_APP_MY_VARIABLE;

0 commit comments

Comments
 (0)