From a2360b480bb2da9f1c728279fdf670b9ba53b3c6 Mon Sep 17 00:00:00 2001 From: Alina1906 Date: Thu, 1 Aug 2024 00:39:01 +0300 Subject: [PATCH] state test added --- src/patterns/state.ts | 3 ++- tests/state.test.ts | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/state.test.ts diff --git a/src/patterns/state.ts b/src/patterns/state.ts index 66319d5..6e2639b 100644 --- a/src/patterns/state.ts +++ b/src/patterns/state.ts @@ -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 } diff --git a/tests/state.test.ts b/tests/state.test.ts new file mode 100644 index 0000000..bfb7ad4 --- /dev/null +++ b/tests/state.test.ts @@ -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) + }) +})