Skip to content

Commit ddf7572

Browse files
committed
chore: wip
1 parent b2e853b commit ddf7572

File tree

6 files changed

+16
-57
lines changed

6 files changed

+16
-57
lines changed
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { runCommand } from '@stacksjs/cli'
22
import { NpmScript } from '@stacksjs/enums'
3-
import { frameworkPath } from '@stacksjs/path'
3+
import { projectPath } from '@stacksjs/path'
44

5-
await runCommand(NpmScript.Test, { verbose: true, cwd: frameworkPath() })
5+
console.log('Running Test...', NpmScript.Test)
6+
await runCommand(NpmScript.Test, { verbose: true, cwd: projectPath() })

storage/framework/core/actions/src/test/coverage.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

storage/framework/core/buddy/src/commands/test.ts

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export function test(buddy: CLI) {
2020

2121
buddy
2222
.command('test', descriptions.command)
23+
.option('-f, --feature', descriptions.feature, { default: false })
24+
.option('-u, --unit', descriptions.unit, { default: false })
2325
.option('--ui', descriptions.ui, { default: false })
2426
.option('-p, --project [project]', descriptions.project, { default: false })
2527
.option('--verbose', descriptions.verbose, { default: true })
@@ -73,24 +75,16 @@ export function test(buddy: CLI) {
7375

7476
buddy
7577
.command('test:feature', descriptions.feature)
76-
.option('--show-report', descriptions.showReport, { default: false })
7778
.option('--verbose', descriptions.verbose, { default: false })
7879
.action(async (options: TestOptions) => {
7980
const perf = await intro('buddy test:feature')
8081
let result
8182

82-
if (options.showReport)
83-
result = await runAction(Action.ShowFeatureTestReport, {
84-
...options,
85-
verbose: true,
86-
cwd: projectPath(),
87-
})
88-
else
89-
result = await runAction(Action.TestFeature, {
90-
...options,
91-
verbose: true,
92-
cwd: projectPath(),
93-
})
83+
result = await runAction(Action.TestFeature, {
84+
...options,
85+
verbose: true,
86+
cwd: projectPath(),
87+
})
9488

9589
if (result.isErr()) {
9690
await outro(
@@ -160,30 +154,6 @@ export function test(buddy: CLI) {
160154
})
161155
})
162156

163-
buddy.command('test:coverage', descriptions.coverage).action(async (options: TestOptions) => {
164-
const perf = await intro('buddy test:coverage')
165-
const result = await runAction(Action.TestCoverage, {
166-
...options,
167-
cwd: projectPath(),
168-
verbose: true,
169-
})
170-
171-
if (result.isErr()) {
172-
await outro(
173-
'While running `buddy test:coverage`, there was an issue',
174-
{ startTime: perf, useSeconds: true },
175-
result.error,
176-
)
177-
process.exit()
178-
}
179-
180-
await outro('Generated the test coverage report', {
181-
startTime: perf,
182-
useSeconds: true,
183-
})
184-
process.exit()
185-
})
186-
187157
buddy.on('test:*', () => {
188158
console.error('Invalid command: %s\nSee --help for a list of available commands.', buddy.args.join(' '))
189159
process.exit(1)

storage/framework/core/enums/src/index.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ export enum NpmScript {
1919
LintFix = 'bunx biome check --fix',
2020
LintPackageJson = 'publint',
2121
MakeStack = 'make:stack',
22-
Test = 'bun test',
23-
TestUnit = 'bun test 2',
24-
TestFeature = 'playwright test --config playwright.config.ts',
22+
Test = 'bun test ./tests/feature/** ./tests/unit/**',
23+
TestUnit = 'bun test ./tests/unit/**',
24+
TestFeature = 'bun test ./tests/feature/**',
2525
TestUi = 'bun test 3',
26-
TestCoverage = 'bun test 4',
2726
TestTypes = 'vue-tsc --noEmit',
2827
Generate = 'generate',
2928
GenerateTypes = 'generate:types',
@@ -86,12 +85,10 @@ export enum Action {
8685
Prepublish = 'prepublish',
8786
Release = 'release', // ✅
8887
RouteList = 'route/list', // ✅
89-
ShowFeatureTestReport = 'show-feature-test-report',
9088
Test = 'test',
9189
TestUi = 'test-ui',
9290
TestUnit = 'test-unit',
9391
TestFeature = 'test-feature',
94-
TestCoverage = 'test-coverage',
9592
Typecheck = 'typecheck',
9693
Upgrade = 'upgrade/index',
9794
UpgradeBinary = 'upgrade/binary', // the `stacks` binary

storage/framework/core/types/src/cli.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,9 @@ export type ExamplesOptions = {
304304
[key in ExamplesBoolean]: boolean
305305
} & CliOptions
306306
export type TestOptions = CliOptions & {
307-
showReport?: boolean
307+
ui?: boolean
308+
feature?: boolean
309+
unit?: boolean
308310
}
309311
export type DomainsOptions = CliOptions & {
310312
domain?: string

tests/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)