| Total files | Total lines of code | Duplicated lines | % of duplications |
|---|---|---|---|
| 230 | 6281 | 139 | 2.21% |
0% Total files: 39, total lines of code: 687, duplicated lines: 0[Top ↑↑↑]
0% Total files: 16, total lines of code: 128, duplicated lines: 0[Top ↑↑↑]
2.52% Total files: 40, total lines of code: 911, duplicated lines: 23[Top ↑↑↑]
},
"devDependencies": {
"gulp-cli": "^2.2.0",
"tslint": "^5.18.0",
"typescript": "^3.5.0"
},
"scripts": {
"build": "./node_modules/.bin/gulp build --config data-stack",
"depcheck": "../../node_modules/.bin/depcheck || true",
"lint:ts:tslint": "./node_modules/.bin/tslint -p . -c ../../tslint.json",
"lint:ts:ci:tslint": "./node_modules/.bin/tslint -p . -c ../../tslint.json -t checkstyle -o reports/tslint-tslint.xml"
},
"paths": {
"build": {
"base": "./dist",
"js": "./dist/*.js",
"main": "./dist/index.js"
},
"src": {
"base": "./src",
"ts": "./src/**/*.ts"
}
}
}0% Total files: 21, total lines of code: 616, duplicated lines: 0[Top ↑↑↑]
0% Total files: 1, total lines of code: 8, duplicated lines: 0[Top ↑↑↑]
3.03% Total files: 99, total lines of code: 3660, duplicated lines: 111[Top ↑↑↑]
;
const expected = document.createElement("p");
const when = document.createElement("span");
when.textContent = whenMessage;
const what = document.createElement("span");
what.textContent = ` - ${eventMessage}`;
expected.appendChild(when);
expected.appendChild(what);
Console.getInstance().append(eventMessage);
expect(
document.getElementsByClassName("console")[0],, (): void => {
const manager = new Engine();
const entity = manager.createEntity();
expect(entity).not.toBeNull();
expect(entity).toBeInstanceOf(Entity);
expect(manager.getEntities().size).toBe(1);
manager.removeEntity("42", (): void => {
const model = new ConcreteObservable();
expect(model.getObservers().length).toBe(0);
const observer = new ConcreteObserver();
model.attach(observer);
expect(model.getObservers().length).toBe(1);
modelconst screenEnterSpy = jest.spyOn(StartScreen.prototype, "enter");
const screenRenderSpy = jest.spyOn(StartScreen.prototype, "render");
const screen = new StartScreen(new Engine());
const game = new Game();
game.switchScreen(screen);
game();
screen.render(new Display(24, 80));
expect(displaySpy).toHaveBeenCalledTimes(22);
});
describe("handleInput", () => {
each([
[
null,
{
data: {},
type: "keydown",
},
],
[
null,
{
data: { keyCode: Keys.RETURN },
type: "keydown",
},
],
]).test(" should return appropriate value", (expected, params) => {
const screen = new WinScreen, (): void => {
const mockEntity = new Entity("42");
mockEntity.addComponent(new MoveableComponent());
mockEntity.addComponent(new PositionComponent());
const mockEntities: Map<string, Entity> = new Map<string, Entity>();
mockEntities.set("42", mockEntity);
const mockMove;
const mockMap = new GameMap(1, 1);
const mapPosition = { x: 0, y: 0 };
const originalImpl = GameMap.prototype.getTile;
GameMap.prototype.getTile = jest.fn().mockImplementation(() => {
return mockTile;
});
const system = new MovementSystem(entities, mapPosition);
const mapPosition = { x: 0, y: 0 };
const originalImpl = GameMap.prototype.getTile;
GameMap.prototype.getTile = jest.fn().mockImplementation(() => {
return mockTile;
});
const system = new MovementSystem(entities, mapPosition, mockMap);
const expected: MoveInterface = {
canMove: false();
const mockMap = new GameMap(1, 1);
const mapPosition = { x: 0, y: 0 };
const originalImpl = GameMap.prototype.getTile;
GameMap.prototype.getTile = jest.fn().mockImplementation(() => {
return mockTile;
});
const system = new MovementSystem(entities, mapPosition, mockMap);
const expected: MoveInterface = {
canMove: false,
newPosition: mapPosition,
};
expect(system.canMove()).toStrictEqual(expected);
GameMap.prototype.getTile = originalImpl;
});
}0% Total files: 1, total lines of code: 8, duplicated lines: 0[Top ↑↑↑]
8.93% Total files: 2, total lines of code: 56, duplicated lines: 5[Top ↑↑↑]
<title>{{%PROJECT_TITLE%}}</title>
<link type="text/plain" rel="author" href="humans.txt" />
<link href="./vendor.css" rel="stylesheet" />
<link href="./style.css" rel="stylesheet" />
</head>
<body 0% Total files: 11, total lines of code: 207, duplicated lines: 0[Top ↑↑↑]