Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@cfpreview/pages-e2e-test-runner-cli
Advanced tools
A fixture is the skeleton of a Pages project. You'll usually want a fixture to be the source code of a framework starter/template. However, you can create more dynamic fixtures which are mostly empty, and automatically run a command (e.g. npx create-react-app@latest
) to bootstrap it instead. Together, this functionality allows you to create fixtures which test historic versions of frameworks, as well as current and upcoming versions.
A feature, on the other hand, is some sort of transformation you do to a fixture. For example, you can add a new page to your fixture which would demonstrates a particular feature of the framework in use. Features are broken out of fixtures so that they can be applied easily across multiple fixtures without copy-pasting, and so updating them is made much easier.
Fixtures and features can each have their own tests.
Create a /pages-e2e/fixtures/<name-of-fixture>/
directory. Populate it with your fixture. You may want to remove any tests and testing config if any came with the project when bootstrapping with something like create-react-app
.
Add any test files to this directory that you want to run against the fixture. More on how to write the tests below.
Create a /pages-e2e/fixtures/<name-of-test>/main.fixture
file:
{
"features": ["list-of-features", "you-want-to-apply", "to-this-fixture"],
// Any bootstrapping command you want to run before triggering a build on the fixture
"setup": "npx create-react-app@latest",
"buildConfig": {
"buildCommand": "echo \"hi\"",
"buildOutputDirectory": "public"
}
}
Features are given the following environment variables:
WORKSPACE_DIR
, the fixture directory that is being used in this test run.Create a /pages-e2e/features/<name-of-feature>/main.feature
file:
{
// Any bootstrapping command you want to run in order to apply this feature to the fixture
"setup": "mkdir -p ${WORKSPACE_DIR}/functions && cp assets/functions-date.ts ${WORKSPACE_DIR}/functions/date.ts"
}
An example of running TypeScript in a setup command can be found in the next-pages-experimental-edge-api-route feature.
Any **/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}
files in the fixture or applied feature directories will be run with Vitest. Tests are given the following environment variables:
DEPLOYMENT_URL
, the URL of the deployed site. We've already validated that this is live, so you're free to immediately start hitting it. It does not have a trailing slash.Here's a simple test which asserts the deployment contains the string "Hello, world!":
import { describe, it } from "vitest";
describe("Simple HTML project", () => {
it("should say 'Hello, world!' at the root", async ({ expect }) => {
const response = await fetch(`${DEPLOYMENT_URL}/`);
expect(await response.text()).toContain("Hello, world!");
});
});
Additionally, tests in the /pages-e2e/__tests__/
directory are run globally on every fixture.
make setup
.make setup
for each of the features
defined in the fixture Makefile
.Apply Cloudflare_CA.pem
Pretty results
Allow custom build output directories
Matrix mode
Local mode using Wrangler
Staging mode
Direct Upload mode
Decent logging
Allow customizable deployment config per fixture
Migrate security test
Populate with a selection of framework fixtures
Move to TeamCity and configure cron
Alert failures
Make it easier to add new types of bindings
Error when there's a conflict on binding names
Extend vitest matchers when using Playwright
VARIANTS
FAQs
## Fixtures vs. Features
We found that @cfpreview/pages-e2e-test-runner-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.