Skip to content

Commit

Permalink
state test added
Browse files Browse the repository at this point in the history
  • Loading branch information
Alina1906 committed Jul 31, 2024
1 parent ad7e2b4 commit a2360b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/patterns/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ class Context {
}
}

export const state = () => {
export const state = (): true => {
const context: Context = new Context()
context.request()
context.setState(new ConcreteStateB())
context.request()
return true
}
8 changes: 8 additions & 0 deletions tests/state.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {state} from "../src/patterns"

describe('KAN_T1_State Test', () => {
it('should return true working with the instance', () => {
const result = state()
expect(result).toBe(true)
})
})

0 comments on commit a2360b4

Please sign in to comment.