This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const browser = await puppeteer.launch({ | |
args: ['--no-sandbox'], | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:16.13.1 # Specific version, not the lastest | |
RUN ["apt-get", "update"] | |
RUN apt-get install gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils -y | |
RUN apt-get update \ | |
&& apt-get install -y wget --no-install-recommends \ | |
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ | |
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ | |
&& apt-get update \ | |
&& apt-get install -y google-chrome-unstable --no-install-recommends \ | |
&& rm -rf /var/lib/apt/lists/* \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports.insertGremlins = async (page) => { | |
await page.evaluate(() => { | |
const s = document.createElement('script'); s.src='gremlins.min.js'; | |
document.head.appendChild(s); | |
}); | |
}; | |
module.exports.runGremlins = async (page) => { | |
await page.evaluate(() => { | |
window.gremlins.createHorde().unleash() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
const errors = []; | |
page.on('pageerror', (error) => { | |
browserErrors.push(error); | |
}); | |
await page.goto('localhost:4200'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in src/**/*.js; do | |
git mv "$f" "${f%.js}.ts" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Module1ActionContext = { | |
... | |
dispatch<K extends keyof Module2Actions>( | |
actionType: `module2Namespace/${keyof Module2Actions}`, | |
payload?: Parameters<Module2Actions[K]>[1], | |
options?: DispatchOptions, | |
): Promise<void> | void; | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dispatch( | |
`${module2Namespace}/actionB2` as const, | |
payload, | |
{ root: true }, | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dispatch( | |
`${module2Namespace}/actionB2`, | |
payload, | |
{ root: true }, | |
); // ERROR: Argument of type 'string' is not assignable to parameter of type '"module2Namespace/actionB1" | ""module2Namespace/actionB1"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dispatch( | |
`${module2Namespace}/actionB2` as 'actionB2', | |
payload, | |
{ root: true }, | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Module1ActionContext = { | |
... | |
dispatch<K extends keyof Module2Actions>( | |
actionType: keyof Module2Actions, | |
payload?: Parameters<Module2Actions[K]>[1], | |
options?: DispatchOptions, | |
): Promise<void> | void; | |
... | |
} |
NewerOlder