-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fbd9d41
commit e846667
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
packages/container/libraries/core/src/common/calculations/getSelf.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { beforeAll, describe, expect, it } from '@jest/globals'; | ||
|
||
import { getSelf } from './getSelf'; | ||
|
||
describe(getSelf.name, () => { | ||
let value: unknown; | ||
|
||
beforeAll(() => { | ||
value = Symbol(); | ||
}); | ||
|
||
describe('when called', () => { | ||
let result: unknown; | ||
|
||
beforeAll(() => { | ||
result = getSelf(value); | ||
}); | ||
|
||
it('should return expected value', () => { | ||
expect(result).toBe(value); | ||
}); | ||
}); | ||
}); |
3 changes: 3 additions & 0 deletions
3
packages/container/libraries/core/src/common/calculations/getSelf.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function getSelf<T>(self: T): T { | ||
return self; | ||
} |