https://github.com/isthatcentered/traceable
https://github.com/isthatcentered/traceable
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/isthatcentered/traceable
- Owner: isthatcentered
- License: mit
- Created: 2020-06-13T10:25:59.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-08T14:25:48.000Z (almost 6 years ago)
- Last Synced: 2025-03-12T09:40:19.073Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 142 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Traceable
Object tagging for your tests
## Before

## After

### How to use
```typescript
import traceable from "jest-traceable"
test(`Displays turn winner`, () => {
// Tag objects
const winner = traceable(makeWinner(), "winner")
const looser = traceable(makeLooser(), "looser")
// Some code
const ui = { notifyWinner: jest.fn() }
const game = new Game(ui)
game.turn(winner, looser)
// Verify object passing
expect(ui.notifyWinner).toHaveBeenCalledWith(winner)
})
```
[Full example](./src/demo.spec.ts)