Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove lint warnings, update tests and rename file #1691

Merged
merged 5 commits into from May 9, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/cli/babel/index.js
@@ -1,3 +1,5 @@
// Is this file used/required? If not, can it be removed?
rschristian marked this conversation as resolved.
Show resolved Hide resolved

rschristian marked this conversation as resolved.
Show resolved Hide resolved
var isProd = (process.env.BABEL_ENV || process.env.NODE_ENV) === 'production';
/**
* test env detection is used to default mode for
Expand All @@ -21,7 +23,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);
rschristian marked this conversation as resolved.
Show resolved Hide resolved
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;