Files
superset2/.github/actions/file-changes-action/src/tests/mocks/fs/index.ts
Jesse Yang a3bbbf8ea3 build: inline external Github Actions to unblock CI (#12241)
* build: inline cached-dependencies to unblock CI

* Run E2E on pull_request on;y

* Inline all external actions

* Checkout needed for internal actions

Also fixes pre-commit

* Add missing files
2021-01-04 14:16:07 +02:00

15 lines
401 B
TypeScript

import {FsMock} from 'typings/FsMock'
const fsMock = {
writeFileSync: jest.fn((path, data, options) => {
if (path === 'error')
throw new Error(JSON.stringify({name: 'PathError', status: '500'}))
// console.log(`fs.writeFileSync triggered with path: ${path} data: ${data} options: ${options}`)
})
}
export function mock(): FsMock {
jest.mock('fs', () => fsMock)
return fsMock
}