
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@prismicio/e2e-tests-utils
Advanced tools
This library comprises utility functions tailored for end-to-end tests at Prismic, with a primary focus on tasks like repository creation, configuration, and deletion.
In the context of testing, it's essential to operate in a controlled environment where the necessary conditions are defined explicitly. To avoid redundant logic across various services for setting up test data, this library consolidates and provides the required functionalities.
npm install --save-dev @prismicio/e2e-tests-utils
Useful to run the tests on a clean repository with a controlled configuration, for example in a CI.
import { createRepositoriesManager } from "@prismicio/e2e-tests-utils";
import type { RepositoryConfig } from "@prismicio/e2e-tests-utils";
const config: RepositoryConfig = {
locales: ["en-gb", "fr-fr"],
defaultLocale: "en-gb",
// ... see RepositoryConfig for other options
};
const authConfig = { email, password };
const testUtils = createRepositoriesManager({ urlConfig :"https://prismic.io", authConfig});
const repository = await testUtils.createRepository(config);
// A repository is now available with a unique name and configured as required
repository.getBaseURL() // https://my-unique-repo-name.prismic.io
// run your tests, delete the repository
await testUtils.tearDown();
Use Custom Types and Shared slices typed from the @prismicio/types-internal
library.
If the custom types already exists on the repository, they will be updated.
import { createRepositoriesManager } from "@prismicio/e2e-tests-utils";
import {
CustomType,
SharedSlice,
} from "@prismicio/types-internal/lib/customtypes";
const slice: SharedSlice = {
id: "test_slice",
type: "SharedSlice",
name: "A slice demo",
// ...
};
const customType: CustomType = {
id: "test_ct",
label: "A custom type",
// ...
json: {
Main: {
slices: {
type: "Slices",
fieldset: "Slice Zone",
config: {
choices: {
[slice.id]: {
type: "SharedSlice",
},
},
},
},
},
},
};
// Create them individually
await repository.createSlices([slice]);
await repository.createCustomTypes([customType]);
// Or create them via the RepositoryConfig object
const config = { slices: [slice], customTypes: [customType] };
await testUtils.createRepository(config);
const token = await testUtils.getUserApiToken();
The library provides a few api clients for Prismic services. For example the Content Api.
const contentApi = repository.getContentApiClient();
const document = await contentApi.getDocumentByID(documentId);
The @prismicio/client
package could have been used but had too many abstractions (caching, error handling) that we don't necessarly want for test execution.
const repository = await testUtils.getRepositoryManager(name);
// configure multiple settings and once
await repository.configure(settings);
// or configure them individually
await repository.createRelease("next release");
When you create the manager, you have 2 options:
createRepositoriesManager({ urlConfig: "https://prismic.io", authConfig: credentials })
. The library infers the service urls from the base URL like http://authentication.prismic.io
createRepositoriesManager({ urlConfig: { baseURL: "https://...", customTypesApi : "https://...", authenticationApi : "https://..."}, authConfig })
By default, the library logs each operation, this can be changed:
prismic_e2e_tests_utils_silent
to true
to remove all logs.prismic_e2e_tests_utils_log_level
to info
or debug
.FAQs
A collection of utilities for to manage Prismic test data
We found that @prismicio/e2e-tests-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 26 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.