noflake init
Initialize NoFlake in your project. Sets up configuration, directories, and optional git hooks.
ā
Available in v0.0.x
Usage
npx noflake init [options]Options
| Flag | Description | Default |
|---|---|---|
--hook | Install a post-commit git hook for auto-updates | false |
What it does
- Creates
.noflake/directory ā State folder for test manifests, plans, and run history - Generates
.noflakerc.jsonā Configuration file with sensible defaults for your project - Creates
tests/e2e/ā Directory where generated tests will live - Updates
.gitignoreā Adds run history to .gitignore (ephemeral data) - Generates
playwright.config.tsā If you don't have one, creates a config targetingtests/e2e/with Chrome, screenshots on failure, and a dev server - Installs git hook (with
--hook) ā A post-commit hook that runsnoflake updateautomatically
Example
$ npx noflake init --hook
š„ NoFlake ā Init
ā
Created .noflakerc.json
ā
Created tests/e2e/
ā
Updated .gitignore
ā
Created playwright.config.ts
ā
Installed post-commit hook
š NoFlake initialized!
Next steps:
noflake write ā Generate your test suite
noflake run ā Run tests and get a report
noflake update ā Patch tests after code changesGenerated Playwright Config
The generated playwright.config.ts includes:
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './tests/e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: [
['json', { outputFile: '.noflake/playwright-results.json' }],
['html']
],
use: {
baseURL: 'http://localhost:3000',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
},
projects: [
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
],
webServer: {
command: 'npm run dev',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
},
});