Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
screeps-test-helper
Advanced tools
Helper functions and environment for unit testing your Screeps code.
Fork of https://github.com/eduter/screeps-jest that has been updated to be test framework agnostic. All credit should go to Eduter.
Helper functions for unit testing your Screeps AI.
Features:
RoomPosition
already mockednpm install screeps-test-helper --save-dev
Before any of your tests run you will need to call the setup(global)
function.
There is a Jest Environment provided.
Mocha will require creating a file that calls the setup function that is loading using --require
when using the CLI or referenced in the .mocharc.*
file.
Example ./src/test_globals.ts
for Mocha:
import {setup} from 'screeps-test-helper';
setup(global);
The file can be referenced by the .mocharc.json
file like so:
{
"extension": [
"ts"
],
"spec": "./src/**/*.test.ts",
"require": [
"ts-node/register",
"./src/test_globals.ts"
]
}
import { mockGlobal, mockInstanceOf, mockStructure } from "screeps-test-helper";
mockGlobal<Game>('Game', {
time: 123
});
const creep = mockInstanceOf<Creep>({
moveTo: () => OK,
store: {
getFreeCapacity: () => 0
},
transfer: () => ERR_NOT_IN_RANGE
});
const spawn = mockStructure(STRUCTURE_SPAWN, {
hits: 5000,
hitsMax: 5000
});
FAQs
Helper functions and environment for unit testing your Screeps code.
The npm package screeps-test-helper receives a total of 0 weekly downloads. As such, screeps-test-helper popularity was classified as not popular.
We found that screeps-test-helper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.