| Total files | Total lines of code | Duplicated lines | % of duplications |
|---|---|---|---|
| 282 | 7285 | 109 | 1.5% |
0% Total files: 52, total lines of code: 716, duplicated lines: 0[Top ↑↑↑]
0% Total files: 24, total lines of code: 168, duplicated lines: 0[Top ↑↑↑]
0% Total files: 56, total lines of code: 1333, duplicated lines: 0[Top ↑↑↑]
0% Total files: 20, total lines of code: 601, duplicated lines: 0[Top ↑↑↑]
0% Total files: 1, total lines of code: 8, duplicated lines: 0[Top ↑↑↑]
2.34% Total files: 115, total lines of code: 4189, duplicated lines: 98[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);
const renderer = new HTMLConsoleRenderer();
renderer.write(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()).toHaveLength(0);
const observer = new ConcreteObserver();
model.attach(observer);
expect(model.getObservers()).toHaveLength(1);
model, (): 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 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;
});
}const 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);
});
describe("handleInput", () => {
each([
[
null,
{
data: {},
type: "keydown",
},
],
[
null,
{
data: { keyCode: Keys.RETURN },
type: "keydown",
},
],
]).test(" should return appropriate value", (expected, params) => {
const screen = new WinScreen0% Total files: 1, total lines of code: 8, duplicated lines: 0[Top ↑↑↑]
20% Total files: 2, total lines of code: 55, duplicated lines: 11[Top ↑↑↑]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="application-name" content="Pixel-Art" />
<meta name="robots" content="index, follow" />
<meta name="google" content="nositelinkssearchbox" />
<meta name="version" content="{{%VERSION%}}" />
<link rel="home" href="/" />
<title>{{%PROJECT_TITLE%}}</title>
<link href0% Total files: 11, total lines of code: 207, duplicated lines: 0[Top ↑↑↑]