Skip to content

Commit

Permalink
fix: remove lint warnings, update tests and rename file (#1691)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
zubhav and rschristian committed May 9, 2022
1 parent 6c6316e commit 49bba04
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/cli/babel/index.js
Expand Up @@ -21,7 +21,7 @@ var defaultBrowserListDev = [
'ios_saf >= 10.3',
'edge >= 16',
'opera >= 48',
'samsung >= 8.2'
'samsung >= 8.2',
];

// preact-cli babel configs
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/cli/sw/index.js
@@ -1,7 +1,7 @@
import { registerRoute, setCatchHandler } from 'workbox-routing';
import { precacheAndRoute, getCacheKeyForURL } from 'workbox-precaching';
import { isNav } from './utils';
import { NETWORK_HANDLER, PRECACHING_OPTIONS } from './contants';
import { NETWORK_HANDLER, PRECACHING_OPTIONS } from './constants';

export function getFiles() {
return self.__WB_MANIFEST;
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/tests/build.test.js
Expand Up @@ -182,8 +182,10 @@ describe('preact build', () => {
`${dir}/build/${bundleFile}`,
'utf8'
);

// "Hello World!" should replace 'process.env.PREACT_APP_MY_VARIABLE'
expect(transpiledChunk.includes('console.log("Hello World!")')).toBe(true);
expect(transpiledChunk.includes('"Hello World!"')).toBe(true);
expect(transpiledChunk.includes('PREACT_APP_MY_VARIABLE')).toBe(false);
});

it('should respect `publicPath` value', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/tests/lib/chrome.js
Expand Up @@ -12,7 +12,7 @@ module.exports.waitUntilExpression = async function (page, expression) {
`Waiting for ${expression}`
);

return result; // && result.value;
return result;
};

await waitUntil(evaluate, `Waiting for ${expression} timed out!`);
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/tests/lib/output.js
Expand Up @@ -10,7 +10,7 @@ async function tmpDir() {
let str = Math.random()
.toString(36)
.replace(/[^a-z]+/g, '')
.substr(0, 12);
.substring(0, 12);
await mkdir(output, { recursive: true });
return resolve(output, str);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/tests/subjects/custom-dotenv/index.js
@@ -1 +1 @@
console.log(process.env.PREACT_APP_MY_VARIABLE);
export const MY_VARIABLE = process.env.PREACT_APP_MY_VARIABLE;

0 comments on commit 49bba04

Please sign in to comment.