New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@dip-in-milk/snake

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dip-in-milk/snake - npm Package Compare versions

Comparing version 1.0.1-0 to 1.0.1-1

2

package.json
{
"name": "@dip-in-milk/snake",
"version": "1.0.1-0",
"version": "1.0.1-1",
"description": "",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -48,3 +48,5 @@ import DIRECTION from './DIRECTION';

this.gameObjects.forEach((gameObject) => {
gameObject.tick();
if ('tick' in gameObject) {
gameObject.tick();
}
});

@@ -51,0 +53,0 @@ }

@@ -50,6 +50,2 @@ import DIRECTION from './DIRECTION';

tick() {
throw new Error(`Method "tick" should be implemented for ${this.constructor.name}`);
}
/**

@@ -56,0 +52,0 @@ * Being killed by a gameObject

@@ -5,2 +5,3 @@ import Game from '../../src/Game';

import Pixel from '../../src/Pixel';
import Fruit from '../../src/Fruit';

@@ -48,7 +49,15 @@ jest.mock('../../src/Snake');

describe('#tick', () => {
game.gameObjects = [
new Fruit(),
new Snake(),
];
game.tick();
it('should call player.tick() for each gameObject', () => {
it('should call player.tick() for each gameObject which has tick method', () => {
game.gameObjects.forEach((gameObject) => {
expect(gameObject.tick).toBeCalled();
if (gameObject.tick) {
expect(gameObject.tick).toBeCalledWith();
} else {
expect(gameObject.tick).toBe(undefined);
}
});

@@ -55,0 +64,0 @@ });

@@ -75,8 +75,2 @@ import GameObject from '../../src/GameObject';

});
describe('#tick', () => {
it('should throw an Error', () => {
expect(gameObject.tick).toThrowError();
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc