Files
vercel__flags/tests/next-16/flags.tsx
Dominik Ferber 0910327c65 add next-16 tests (#195)
* add next-16 tests

* upgrade biome

* upgrade react in next-16

* tsconfig

* try with middleware.ts

* Revert "try with middleware.ts"

This reverts commit 894b6ed5ce.

* Revert "try adding executablePath"

This reverts commit a4991996fe.

* ensure x-middleware-rewrite

* test x-nextjs-cache

* rm playwright --ui

* adjust biome schema version

* disable getStaticPaths in pages router

* try chromium

* re-enable ci playwright workaround
2025-10-25 00:49:34 +03:00

23 lines
573 B
TypeScript

import { flag } from 'flags/next';
export const exampleFlag = flag<boolean>({
key: 'example-flag',
decide: () => true,
defaultValue: false,
options: [false, true],
});
export const hostFlag = flag<string>({
key: 'host',
decide: ({ headers }) => headers.get('host') || 'no host',
options: ['no host', 'localhost'],
});
export const cookieFlag = flag<string>({
key: 'cookie',
decide: ({ cookies }) => cookies.get('example-cookie')?.value || 'no cookie',
options: ['no cookie'],
});
export const precomputedFlags = [exampleFlag, hostFlag, cookieFlag];