@augment-vir/test 31.50.4 → 31.51.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/dist/test-playwright/screenshot.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
# @augment-vir/test
|
|
2
2
|
|
|
3
|
-
A universal testing suite that works with Mocha style test runners
|
|
3
|
+
A universal testing suite that works with Mocha style test runners, Node.js's built-in test runner, and Playwright tests with the following main exports:
|
|
4
4
|
|
|
5
5
|
- [`describe`](https://electrovir.github.io/augment-vir/functions/describe.html): the normal describe test suite function, automatically imported based on the current environment.
|
|
6
6
|
- [`it`](https://electrovir.github.io/augment-vir/functions/it.html): the normal it test function, automatically imported based on the current environment.
|
|
7
7
|
- [`itCases`](https://electrovir.github.io/augment-vir/functions/itCases.html): a succinct way to test lots of inputs and outputs to a single function.
|
|
8
|
-
- [`testWeb`](https://electrovir.github.io/augment-vir/variables/testWeb.html): a API of web
|
|
8
|
+
- [`testWeb`](https://electrovir.github.io/augment-vir/variables/testWeb.html): a API of web testing utilities, only available in browser environments.
|
|
9
|
+
- [`testPlaywright`](https://electrovir.github.io/augment-vir/variables/testPlaywright.html): a API of Playwright testing utilities, only available in Playwright test environments.
|
|
9
10
|
|
|
10
11
|
See the docs under `Test`, or `Package: @augment-vir/test` here: https://electrovir.github.io/augment-vir
|
|
12
|
+
|
|
13
|
+
## Caveats
|
|
14
|
+
|
|
15
|
+
Playwright does not always set the `PLAYWRIGHT_TEST` env var, especially if you have a playwright config file that imports from TypeScript. If your playwright tests aren't working with this package, try setting `PLAYWRIGHT_TEST="1"` as an env var before calling Playwright (`PLAYWRIGHT_TEST="1" playwright test`).
|
|
@@ -118,7 +118,7 @@ export async function expectScreenshot(testContext, options) {
|
|
|
118
118
|
const screenshotFilePath = getScreenshotPath(testContext, options.screenshotBaseName);
|
|
119
119
|
async function writeNewScreenshot() {
|
|
120
120
|
log.mutate(`Updated screenshot: ${relative(process.cwd(), screenshotFilePath)}`);
|
|
121
|
-
await saveScreenshotBuffer(testContext, currentScreenshotBuffer,
|
|
121
|
+
await saveScreenshotBuffer(testContext, currentScreenshotBuffer, options.screenshotBaseName);
|
|
122
122
|
}
|
|
123
123
|
async function writeExpectationScreenshot(contents, fileName) {
|
|
124
124
|
const filePath = assertWrapTestContext(testContext, TestEnv.Playwright).testInfo.outputPath(addSuffix({ value: fileName, suffix: '.png' }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@augment-vir/test",
|
|
3
|
-
"version": "31.
|
|
3
|
+
"version": "31.51.1",
|
|
4
4
|
"description": "A universal testing suite that works with Mocha style test runners _and_ Node.js's built-in test runner.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"test",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"test:web": "virmator test --no-deps web 'src/test-web/**/*.test.ts' 'src/augments/universal-testing-suite/**/*.test.ts'"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@augment-vir/assert": "^31.
|
|
48
|
-
"@augment-vir/common": "^31.
|
|
47
|
+
"@augment-vir/assert": "^31.51.1",
|
|
48
|
+
"@augment-vir/common": "^31.51.1",
|
|
49
49
|
"@open-wc/testing-helpers": "^3.0.1",
|
|
50
50
|
"@virmator/test": "^14.2.2",
|
|
51
51
|
"type-fest": "^5.2.0"
|