You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
2.8 KiB
59 lines
2.8 KiB
// The tests of src/lib. Vitest prefers this file to vite.config.ts, the
|
|
// SvelteKit configuration of the page, so the library tests run without the
|
|
// SvelteKit plugin; the page helpers in src/lib/inspector import the library
|
|
// by relative paths and need no $lib alias.
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
include: ['src/**/*.test.ts'],
|
|
// BLS12-381 point checks and the 65 536-extension cases take a moment.
|
|
testTimeout: 30_000,
|
|
coverage: {
|
|
provider: 'v8',
|
|
include: ['src/lib/dkc/**/*.ts', 'src/lib/inspector/**/*.ts'],
|
|
exclude: ['src/lib/**/*.test.ts', 'src/lib/dkc/testing/**', 'src/lib/dkc/index.ts'],
|
|
reporter: ['text', 'html', 'json-summary'],
|
|
thresholds: {
|
|
// The codec is covered completely (plan §7), and so are the IBE and
|
|
// the release verification (plan of phase 2, section 10, steps 3
|
|
// and 4).
|
|
'src/lib/dkc/cbor.ts': { 100: true },
|
|
'src/lib/dkc/ibe.ts': { 100: true },
|
|
'src/lib/dkc/release.ts': { 100: true },
|
|
// The stanza X25519 and its Bech32 identities (step 5).
|
|
'src/lib/dkc/x25519.ts': { 100: true },
|
|
'src/lib/dkc/bech32.ts': { 100: true },
|
|
'src/lib/dkc/digest.ts': { 100: true },
|
|
// The tlock recipient (step 7).
|
|
'src/lib/dkc/tlock.ts': { 100: true },
|
|
// The prefix reads, and the opening of the page (step 8).
|
|
'src/lib/dkc/prefix.ts': { 100: true },
|
|
'src/lib/inspector/fixtures.ts': { 100: true },
|
|
'src/lib/inspector/opener.ts': { 100: true },
|
|
'src/lib/inspector/opening.ts': { 100: true },
|
|
'src/lib/inspector/release-input.ts': { 100: true },
|
|
'src/lib/inspector/tempfile.ts': { 100: true },
|
|
// The pieces of the writer (plan of phase 3, step 2) and the age
|
|
// files shared by the opening and the writer.
|
|
'src/lib/dkc/recipient.ts': { 100: true },
|
|
'src/lib/dkc/random.ts': { 100: true },
|
|
'src/lib/dkc/agefile.ts': { 100: true },
|
|
'src/lib/dkc/padding.ts': { 100: true },
|
|
// The writer (plan of phase 3, steps 3 and 4).
|
|
'src/lib/dkc/writer.ts': { 100: true },
|
|
'src/lib/dkc/encrypt.ts': { 100: true },
|
|
// The page of step 7: the lengths known before writing, the local
|
|
// times, the form and the writing loaded on demand.
|
|
'src/lib/dkc/lengths.ts': { 100: true },
|
|
'src/lib/inspector/localtime.ts': { 100: true },
|
|
'src/lib/inspector/create-input.ts': { 100: true },
|
|
'src/lib/inspector/creator.ts': { 100: true },
|
|
'src/lib/dkc/**/*.ts': { statements: 95, branches: 90, functions: 95, lines: 95 },
|
|
// The page model and helpers of the inspector (plan §8, phase 1).
|
|
'src/lib/inspector/**/*.ts': { statements: 95, branches: 90, functions: 95, lines: 95 },
|
|
},
|
|
},
|
|
},
|
|
});
|