mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-10 18:18:56 -04:00
Add n/prefer-node-protocol rule and autofix all bare builtin imports to use the node: prefix. Simplify the simple-import-sort builtins pattern to just ^node: since all imports now use the prefix.
14 lines
422 B
TypeScript
14 lines
422 B
TypeScript
import fs from 'node:fs'
|
|
import path from 'node:path'
|
|
|
|
import { temporaryDirectory } from 'tempy'
|
|
|
|
import { optimisticRenameOverwrite } from '../src/writeBufferToCafs.js'
|
|
|
|
test("optimisticRenameOverwrite() doesn't crash if target file exists", () => {
|
|
const tempDir = temporaryDirectory()
|
|
const dest = path.join(tempDir, 'file')
|
|
fs.writeFileSync(dest, '', 'utf8')
|
|
optimisticRenameOverwrite(`${dest}_tmp`, dest)
|
|
})
|