Created
August 28, 2018 22:23
-
-
Save hasparus/dea7a6365da5522e30e919cfa38c8cfa to your computer and use it in GitHub Desktop.
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
import { Fixture } from '../utils/Fixture'; | |
import { GameLevelClass, GameLevelStateless } from './GameLevel'; | |
const fixture1: Fixture<typeof GameLevelStateless> = { | |
component: GameLevelStateless, | |
namespace: 'GameLevel/typed', | |
props: { | |
player: { | |
name: 'Arthas2000', | |
strength: 100, | |
}, | |
enemy: { | |
name: 'Lich King', | |
// Type 'string' is not assignable to type 'number'. | |
strength: 'godlike', | |
}, | |
}, | |
}; | |
const fixture2: Fixture<typeof GameLevelClass> = { | |
component: GameLevelClass, | |
namespace: 'GameLevel/typed', | |
props: { | |
player: { | |
name: 'Arthas2000', | |
strength: 100, | |
}, | |
enemy: { | |
name: 'Lich King', | |
// Type 'string' is not assignable to type 'number'. | |
strength: 'godlike', | |
}, | |
}, | |
/* | |
Type '{ score: string; }' is not assignable to type '{ score: number; }'. | |
Types of property 'score' are incompatible. | |
Type 'string' is not assignable to type 'number'. | |
*/ | |
state: { | |
score: '2', | |
}, | |
}; | |
export default [fixture1, fixture2]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment