
Research
5 Malicious Chrome Extensions Enable Session Hijacking in Enterprise HR and ERP Systems
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.
@rest-hooks/test
Advanced tools
import { Resource } from '@rest-hooks/rest';
export default class ArticleResource extends Resource {
readonly id: number | undefined = undefined;
readonly content: string = '';
readonly author: number | null = null;
readonly contributors: number[] = [];
pk() {
return this.id?.toString();
}
static urlRoot = 'http://test.com/article/';
}
export default {
full: [
{
request: ArticleResource.list(),
params: { maxResults: 10 },
result: [
{
id: 5,
content: 'have a merry christmas',
author: 2,
contributors: [],
},
{
id: 532,
content: 'never again',
author: 23,
contributors: [5],
},
],
},
],
empty: [
{
request: ArticleResource.list(),
params: { maxResults: 10 },
result: [],
},
],
error: [
{
request: ArticleResource.list(),
params: { maxResults: 10 },
result: { message: 'Bad request', status: 400, name: 'Not Found' },
error: true,
},
],
loading: [],
};
import { MockResolver } from '@rest-hooks/test';
import type { Fixture } from '@rest-hooks/test';
import { Story } from '@storybook/react/types-6-0';
import ArticleList from 'ArticleList';
import options from './fixtures';
export default {
title: 'Pages/ArticleList',
component: ArticleList,
};
export const FullArticleList = ({ result }) => (
<MockResolver fixtures={options[result]}>
<ArticleList maxResults={10} />
</MockResolver>
);
import { CacheProvider } from '@rest-hooks/react';
import { makeRenderRestHook } from '@rest-hooks/test';
import options from './fixtures';
const renderRestHook = makeRenderRestHook(CacheProvider);
it('should resolve list', async () => {
const { result } = renderRestHook(
() => {
return useSuspense(ArticleResource.list(), {
maxResults: 10,
});
},
{ initialFixtures: options.full },
);
expect(result.current).toBeDefined();
expect(result.current.length).toBe(2);
expect(result.current[0]).toBeInstanceOf(ArticleResource);
});
it('should throw errors on bad network', async () => {
const { result } = renderRestHook(
() => {
return useSuspense(ArticleResource.list(), {
maxResults: 10,
});
},
{ initialFixtures: options.error },
);
expect(result.error).toBeDefined();
expect((result.error as any).status).toBe(400);
});
FAQs
Testing utilities for Rest Hooks
The npm package @rest-hooks/test receives a total of 234 weekly downloads. As such, @rest-hooks/test popularity was classified as not popular.
We found that @rest-hooks/test demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.

Research
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.

Research
/Security News
A malicious Chrome extension steals newly created MEXC API keys, exfiltrates them to Telegram, and enables full account takeover with trading and withdrawal rights.