mirror of
https://github.com/apache/superset.git
synced 2026-04-17 07:05:04 +00:00
* 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
15 lines
401 B
TypeScript
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
|
|
}
|