Skip to content

Instantly share code, notes, and snippets.

@hasparus
Created August 28, 2018 22:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hasparus/dea7a6365da5522e30e919cfa38c8cfa to your computer and use it in GitHub Desktop.
Save hasparus/dea7a6365da5522e30e919cfa38c8cfa to your computer and use it in GitHub Desktop.
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