
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
console-test-helpers
Advanced tools
When building CLIs that output to the console, it's useful to be able to record
and validate the console output for subsequent verification. Doing so requires a
console replacement to record the actual console output. console-test-helpers
provides this.
yarn add console-test-helpers --dev
# or
npm install console-test-helpers --save-dev
console-test-helpers
replaces the real console with a fake, which stores the output
in addition to acting as a proxy for all console calls. This means the console will behave
the same, but will gather output for later validation. Validation can be performed using
fixtures that can be asserted against.
Below is an example of its usage in qunit-console-test-helpers
, this sister package to console-test-helpers
.
export function setupMockConsole(hooks: NestedHooks, options: MockConsoleOptions) {
let resetConsole: () => void;
setupFixtures(options); // from the qunit-fixtures package
hooks.beforeEach(function() {
({ resetConsole, consoleState } = mockConsole(options));
});
hooks.afterEach(function() {
resetConsole();
});
}
And below is how it's used within tests.
import { module, test } from 'qunit';
import { setupMockConsole } from 'qunit-console-test-helpers';
// ...
module('With mocked console', function(hooks) {
setupMockConsole(hooks, { fixturePath: './tests/fixtures' });
test('Something that mocks the console', function(assert) {
somethingThatUsesConsole();
assert.console().matches('fixture-name');
});
});
See the Contributing guide for details.
This project is licensed under the MIT License.
FAQs
Test helpers for building console UIs
The npm package console-test-helpers receives a total of 50 weekly downloads. As such, console-test-helpers popularity was classified as not popular.
We found that console-test-helpers 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
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.