parent
da48c22b35
commit
8aefdc5eb2
@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
preset: 'ts-jest',
|
||||
testEnvironment: 'node',
|
||||
testMatch: ["**/__tests__/**/*.ts?(x)", "**/?(*.)+(test).ts?(x)"],
|
||||
};
|
@ -1,64 +0,0 @@
|
||||
import { Game } from '../game';
|
||||
import { GameSolo } from '../GameSolo';
|
||||
|
||||
|
||||
// Instances
|
||||
|
||||
let myMap = new Map<number, number>([
|
||||
[50, 3],
|
||||
[75, 4],
|
||||
[100, 5],
|
||||
[150, 6]
|
||||
]);
|
||||
let game:Game = new GameSolo("id", "bo jeu", require('bob_party/assets/ImagesJeux/blackjack.jpg'), "super jeu", 1, 1, myMap);
|
||||
|
||||
|
||||
// Get tests
|
||||
describe('GameSolo get tests', () => {
|
||||
it('should return id', () => {
|
||||
expect(game.getId()).toBe('id');
|
||||
})
|
||||
it('should return bo jeu', () => {
|
||||
expect(game.getName()).toBe('bo jeu');
|
||||
})
|
||||
it('should return require(blackjack.jpg)', () => {
|
||||
expect(game.getImageSource()).toBe(require('bob_party/assets/ImagesJeux/blackjack.jpg'));
|
||||
})
|
||||
it('should return super jeu', () => {
|
||||
expect(game.getGameSource()).toBe('super jeu');
|
||||
})
|
||||
it('should return 1', () => {
|
||||
expect(game.getNbPlayerMin()).toBe(1);
|
||||
})
|
||||
it('should return 1', () => {
|
||||
expect(game.getNbPlayerMax()).toBe(1);
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
// Setting new values
|
||||
game.setGameSource('trop cool le jeu');
|
||||
game.setImageSource(require('bob_party/assets/ImagesJeux/JeuDeDame.jpg'));
|
||||
game.setName('beau jeu');
|
||||
game.setNbPlayerMin(2);
|
||||
game.setNbPlayerMax(3);
|
||||
|
||||
|
||||
// Set tests
|
||||
describe('GameSolo set tests', () => {
|
||||
it('should return beau jeu', () => {
|
||||
expect(game.getName()).toBe('beau jeu');
|
||||
})
|
||||
it('should return require(JeuDeDame.jpg)', () => {
|
||||
expect(game.getImageSource).toBe(require('bob_party/assets/ImagesJeux/JeuDeDame.jpg'));
|
||||
})
|
||||
it('should return trop cool le jeu', () => {
|
||||
expect(game.getGameSource()).toBe('trop cool le jeu');
|
||||
})
|
||||
it('should return 2', () => {
|
||||
expect(game.getNbPlayerMin()).toBe(2);
|
||||
})
|
||||
it('should return 3', () => {
|
||||
expect(game.getNbPlayerMax()).toBe(3);
|
||||
})
|
||||
})
|
@ -1,7 +1,27 @@
|
||||
{
|
||||
"extends": "expo/tsconfig.base",
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"jsx": "react",
|
||||
"strict": true
|
||||
}
|
||||
"lib": [
|
||||
"dom",
|
||||
"es2017"
|
||||
],
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"noEmit": true,
|
||||
"noUnusedLocals": false,
|
||||
"noUnusedParameters": false,
|
||||
"preserveConstEnums": true,
|
||||
"removeComments": false,
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"target": "esnext"
|
||||
},
|
||||
"include": [
|
||||
"**/*.ts",
|
||||
"**/*.tsx"
|
||||
],
|
||||
"extends": "expo/tsconfig.base"
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue