Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@cfpreview/pages-e2e-test-runner-cli
Advanced tools
Readme
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
The npm package @cfpreview/pages-e2e-test-runner-cli receives a total of 195 weekly downloads. As such, @cfpreview/pages-e2e-test-runner-cli popularity was classified as not popular.
We found that @cfpreview/pages-e2e-test-runner-cli demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.