Skip to content

Commit

Permalink
ci: test
Browse files Browse the repository at this point in the history
  • Loading branch information
nailiable committed Nov 1, 2024
1 parent 6a149bf commit 14f717a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
run: npm install -g pnpm && pnpm install

- name: Run Vitest tests
run: GITHUB_ACTIONS=true pnpm run test
run: pnpm run test
6 changes: 5 additions & 1 deletion packages/ioc/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { Autowired, ClassWrapper, ConstantWrapper, Container, Inject, Injectable
import { AbstractBootstrap } from '../src/bootstrap'

describe('ioc', () => {
it('should 1 + 1 = 2', () => {
expect(1 + 1).toBe(3)

Check failure on line 6 in packages/ioc/test/index.test.ts

View workflow job for this annotation

GitHub Actions / test

test/index.test.ts > ioc > should 1 + 1 = 2

AssertionError: expected 2 to be 3 // Object.is equality - Expected + Received - 3 + 2 ❯ test/index.test.ts:6:19
})

it('should automatic analyze deps', () => {
@Injectable()
class BarService {
Expand Down Expand Up @@ -60,7 +64,7 @@ describe('ioc', () => {
expect(propertyDeps.get('container')).toBeInstanceOf(ClassWrapper)
expect(constructorDeps[0]).toBeInstanceOf(ClassWrapper)
expect(constructorDeps[1]).toBeInstanceOf(ClassWrapper)
expect(constructorDeps[2]).toBeDefined()
expect(constructorDeps[2]).toBeUndefined()
expect(constructorDeps[3]).toBeInstanceOf(ClassWrapper)

const instance: FooService = classFactory.getOrCreateInstance()
Expand Down
2 changes: 1 addition & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ export default defineConfig({
reporter: env.GITHUB_ACTIONS ? [] : ['html', 'clover', 'json'],
},

reporters: ['dot', 'github-actions'],
reporters: env.CI ? ['default', 'github-actions'] : ['dot', 'github-actions'],
},
})

0 comments on commit 14f717a

Please sign in to comment.