@augment-vir/test 31.54.1 → 31.54.2

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.
@@ -1,5 +1,4 @@
1
1
  import { RuntimeEnvError } from '@augment-vir/core';
2
- import { elementCases } from '../test-web/element-cases.js';
3
2
  declare function importWebTestApi(this: void): Promise<RuntimeEnvError | {
4
3
  /**
5
4
  * Cleans up all rendered test HTML by removing the actual wrapper nodes. Common use case is
@@ -46,7 +45,7 @@ declare function importWebTestApi(this: void): Promise<RuntimeEnvError | {
46
45
  */
47
46
  typeText: typeof import("../test-web/type-into-element").typeString;
48
47
  /** Create multiple test cases for element testing. */
49
- elementCases: typeof elementCases;
48
+ elementCases: typeof import("../test-web/element-cases.js").elementCases;
50
49
  }>;
51
50
  /**
52
51
  * A suite of web test helpers. This is only accessible within a browser runtime. If accessed
@@ -1,5 +1,4 @@
1
1
  import { isRuntimeEnv, RuntimeEnv, RuntimeEnvError } from '@augment-vir/core';
2
- import { elementCases } from '../test-web/element-cases.js';
3
2
  async function importWebTestApi() {
4
3
  if (!isRuntimeEnv(RuntimeEnv.Web)) {
5
4
  return new RuntimeEnvError("The 'testWeb' api cannot be used outside of a browser context.");
@@ -9,6 +8,7 @@ async function importWebTestApi() {
9
8
  const { deleteAllTextInInput, typeString, typeStringIntoElement } = await import('../test-web/type-into-element');
10
9
  const { fixtureCleanup, fixture } = await import('@open-wc/testing-helpers');
11
10
  const { renderElement } = await import('../test-web/render-element');
11
+ const { elementCases } = await import('../test-web/element-cases.js');
12
12
  return {
13
13
  /**
14
14
  * Cleans up all rendered test HTML by removing the actual wrapper nodes. Common use case is
@@ -1,5 +1,4 @@
1
- import { assert, waitUntil } from '@augment-vir/assert';
2
- import { ensureArray } from '@augment-vir/common';
1
+ import { assert, check, waitUntil } from '@augment-vir/assert';
3
2
  import { itCasesWithContext, } from '../augments/universal-testing-suite/it-cases-with-context.js';
4
3
  import { renderElement } from './render-element.js';
5
4
  import { extractElementText } from './symlinked/element-text.js';
@@ -35,8 +34,10 @@ async function testRenderElement(testContext, elementDefinition, testCase) {
35
34
  await testCase.act?.(instance);
36
35
  await waitUntil.isTrue(() => {
37
36
  const text = extractElementText(instance);
38
- if (testCase.expect?.text) {
39
- assert.hasValues(text, ensureArray(testCase.expect.text));
37
+ if (check.isArray(testCase.expect?.text)) {
38
+ assert.hasValues(text, testCase.expect.text);
39
+ }
40
+ else if (check.isString(testCase.expect?.text)) {
40
41
  assert.hasValue(text, testCase.expect.text);
41
42
  }
42
43
  if (testCase.expect?.events) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@augment-vir/test",
3
- "version": "31.54.1",
3
+ "version": "31.54.2",
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.54.1",
48
- "@augment-vir/common": "^31.54.1",
47
+ "@augment-vir/assert": "^31.54.2",
48
+ "@augment-vir/common": "^31.54.2",
49
49
  "@open-wc/testing-helpers": "^3.0.1",
50
50
  "@virmator/test": "^14.3.0",
51
51
  "type-fest": "^5.2.0"