
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@moltin/component-test-framework
Advanced tools
The framework comes with a set of Yeoman generators which can help scaffold the entire component test directory.
For this to work, you will need Yeoman installed (npm i -g yo
).
From within the root directory of the service:
$ yo component-tests:scaffold
If the component-tests directory already exists, you will be prompted to resolve the conflicts.
The framework exposes a few classes:
This is the class responsible for communicating with your API. You can use the methods directly, however, it's usually a better idea to have it as a binding.
Example
import { binding, then } from 'cucumber-tsflow'
import { Api } from 'component-test-framework'
@binding([ Api ])
export default class MyStepDefinitions {
constructor(protected api: Api) {
}
@then(...)
public async myStep(): void {
await this.api.get('/products')
}
...
Examples are generated once you run the scaffold generator.
When working with the api in your component tests, it's often benificial to reference the last created resource
Example
Given An admin creates a product
When They get the created product
For this, we can use the ResourceStore. When ever you use the Api module, it stores the resource that was created, or fetched in the resource store. Knowing that, we can create our step definition to easily fetch the last created resource
Example
import { ResourceStore } from 'component-test-framework'
...
const resource = ResourceStore.LastCreated('file')
We can also get all of the resources under one type
Example
import { ResourceStore } from 'component-test-framework'
...
const resource = ResourceStore.FetchByType('file')
And find a resource
Example
import { ResourceStore } from 'component-test-framework'
...
const resource = ResourceStore.Find('file', 'id', 'abc-123')
FAQs
A framework for component tests written using ts-flow
We found that @moltin/component-test-framework demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 11 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
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.