Skip to content
← Public packages

@kentcdodds/codemod-runner

Run codemods over your own saved packages: scan, dry-run with real publish checks and diffs, apply, and revert.

src/scan-paths.test.ts

43 lines · 846 B · TypeScript
import assert from 'node:assert/strict'
import { describe, it } from 'node:test'
import { selectScanPaths } from './scan-paths.ts'

describe('selectScanPaths', () => {
	it('keeps source, docs, and config text files', () => {
		assert.deepEqual(
			selectScanPaths([
				'package.json',
				'README.md',
				'src/index.ts',
				'src/app.tsx',
				'notes.txt',
				'style.css',
				'config.yaml',
			]),
			[
				'package.json',
				'README.md',
				'src/index.ts',
				'src/app.tsx',
				'notes.txt',
				'style.css',
				'config.yaml',
			],
		)
	})

	it('drops generated declaration files and non-text assets', () => {
		assert.deepEqual(
			selectScanPaths([
				'src/index.ts',
				'src/index.d.ts',
				'src/add-reaction.d.cts',
				'src/legacy.d.mts',
				'icon.png',
				'data.bin',
				'photo.webp',
			]),
			['src/index.ts'],
		)
	})
})