このコミットが含まれているのは:
2026-10-25 14:14:55 +09:00
コミット 304090f717
16個のファイルの変更、745行の追加、27行の削除
+18
ファイルの表示
@@ -0,0 +1,18 @@
import { describe, expect, it } from 'vitest'
import { columnsForCounts, countsCSV } from '@/lib/counts'
describe ('counts exports', () => {
it ('escapes quotes, newlines and spreadsheet formulas in UTF-8 CSV', () => {
expect (countsCSV ([['日本語', 'a"b', 'a\nb', '=1+1']]))
.toBe ('\uFEFF"日本語","a""b","a\nb","\'=1+1"')
})
it ('keeps resource-specific columns out of the other resource', () => {
expect (columnsForCounts ('posts')).toContain ('added_tags')
expect (columnsForCounts ('posts')).not.toContain ('aliases')
expect (columnsForCounts ('tags')).toContain ('aliases')
expect (columnsForCounts ('tags')).not.toContain ('url')
})
})