What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-27 16:00:21
jest axios manual mock
//axios.js const axios = require('axios') module.exports = axios.get //__mocks__/axios.js const axios = require('axios') module.exports = { get: async () => { const url = 'https://jsonplaceholder.typicode.com/posts' const response = await axios... Add solution -
Javascript 2022-03-17 10:55:41
puppeteer wait for select[name=
test("fruit dropdown becomes enabled when food type fruit is selected", async () => { await page.select('[data-testid="food"]', "fruit"); // this makes a selection in the drop down and fires a request // I should wait... Add solution -
Javascript 2022-03-06 23:35:02
Optimize Image Size With JavaScript in Node.js
/* This code comes from Vincent Lab And it has a video version linked here: https://www.youtube.com/watch?v=bmSOapQ5I78 */ // Import dependencies const imagemin = require("imagemin"); const imageminJpegtran = require("imagemin-jpeg... Add solution -
Other 2022-02-17 02:00:27
bullmq
const { Worker } = require('bullmq') const userSchema = require('./model.js') const { resultsPublisher } = require('./publisher') /** * @description queueCreatePublisher */ const queueCreatePublisher = new Worker('create service', async (job) => { ... Add solution -
Javascript 2022-02-02 14:27:43
puppeter example fileupload
const puppeteer = require('puppeteer') const path = require('path') const fs = require('fs') const pathFile = __dirname.split('\\').slice(0, 4).join('/') const fileExitst = fs.existsSync(`${pathFile}/travis_1.png`) const scraperRunner = async () => { ... Add solution -
Javascript 2022-02-02 09:21:03
expo image editor
import { ImageEditor } from "expo-image-editor"; function App() { const [imageUri, setImageUri] = useState(undefined); const [editorVisible, setEditorVisible] = useState(false); const selectPhoto = async () => { // Get the permis... Add solution