Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
additween-mocks
Advanced tools
Mocks for the additween animation library. It can be used with any testing framework (in the usage example below we use jasmine).
It works by replacing some methods of additween
with its stub implementations, which allow to synchronously move animation internal clock forward.
npm install additween-mocks --save
import { AdditiveTweening } from "additween";
import { AdditiveTweeningMock } from "additween-mocks";
describe("my great app", function () {
let additiveTweeningMock = new AdditiveTweeningMock();
beforeEach(function () {
additiveTweeningMock = new AdditiveTweeningMock();
additiveTweeningMock.install(AdditiveTweening);
});
afterEach(function () {
additiveTweeningMock.uninstall(AdditiveTweening);
});
it("should animate perfectly", function () {
// let's say clicking a button
// will cause an animation with 2000ms duration
// we assume there is a triggerClick method defined somewhere
let btn = document.getElementById("byButton");
triggerClick(btn);
// let time go forward by 1000ms
additiveTweeningMock.tick(1000);
//now we can make assertions about animation state after half of time
//expect(...)
// let time go forward by another 1000ms
additiveTweeningMock.tick(1000);
//now we can make assertions about animation final state
//expect(...)
});
});
Creates a new instance of mocking library.
Pass an AdditiveTweening
constructor in order to patch its animation-related methods.
Restores original implementation of passed in AdditiveTweening
.
Moves animation clock forward by duration
msecs. Animation onRender
callback will be called once after that. If duration is greater or equal than total animation duration, onFinish
callback also will be called.
Reset animation clock to its initial state.
FAQs
Mocks for the additween animation library
We found that additween-mocks 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.