@scenetest/checks-solid 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Michael Snook
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,4 @@
1
+ export { createCheck } from './primitives.js';
2
+ export { should, failed, serverCheck, match, defineConfig } from '@scenetest/checks';
3
+ export type { AssertionResult, ScenetestReporter, ScenetestConfig, AssertServerFn, AssertDataFn, ServerContext, AssertionRpcPayload, AssertionRpcResponse, } from '@scenetest/checks';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAG7C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACpF,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,mBAAmB,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ // Solid-specific primitives
2
+ export { createCheck } from './primitives.js';
3
+ // Re-export everything from core scenetest for convenience
4
+ export { should, failed, serverCheck, match, defineConfig } from '@scenetest/checks';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAE7C,2DAA2D;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA"}
@@ -0,0 +1,35 @@
1
+ import { type Accessor } from 'solid-js';
2
+ /**
3
+ * A createEffect wrapper for test code that gets stripped in production.
4
+ *
5
+ * Use this to wrap effects containing assertions (should, failed, serverCheck).
6
+ * The entire effect is removed during production builds.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * import { createCheck, serverCheck, should } from '@scenetest/checks-solid'
11
+ * import { createSignal } from 'solid-js'
12
+ *
13
+ * function Profile() {
14
+ * const [profile, setProfile] = createSignal(null)
15
+ *
16
+ * createCheck(() => {
17
+ * const p = profile()
18
+ * if (!p) return
19
+ *
20
+ * serverCheck(
21
+ * 'profile synced to db',
22
+ * async (server, data) => {
23
+ * const dbUser = await server.getUser(data.id)
24
+ * should('name matches', data.name === dbUser.name)
25
+ * },
26
+ * () => ({ id: p.id, name: p.name })
27
+ * )
28
+ * })
29
+ *
30
+ * return <div>{profile()?.name}</div>
31
+ * }
32
+ * ```
33
+ */
34
+ export declare function createCheck(effect: () => void, deps?: Accessor<unknown>[]): void;
35
+ //# sourceMappingURL=primitives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../src/primitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,IAAI,EAClB,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,GACzB,IAAI,CAQN"}
@@ -0,0 +1,44 @@
1
+ import { createEffect, on } from 'solid-js';
2
+ /**
3
+ * A createEffect wrapper for test code that gets stripped in production.
4
+ *
5
+ * Use this to wrap effects containing assertions (should, failed, serverCheck).
6
+ * The entire effect is removed during production builds.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * import { createCheck, serverCheck, should } from '@scenetest/checks-solid'
11
+ * import { createSignal } from 'solid-js'
12
+ *
13
+ * function Profile() {
14
+ * const [profile, setProfile] = createSignal(null)
15
+ *
16
+ * createCheck(() => {
17
+ * const p = profile()
18
+ * if (!p) return
19
+ *
20
+ * serverCheck(
21
+ * 'profile synced to db',
22
+ * async (server, data) => {
23
+ * const dbUser = await server.getUser(data.id)
24
+ * should('name matches', data.name === dbUser.name)
25
+ * },
26
+ * () => ({ id: p.id, name: p.name })
27
+ * )
28
+ * })
29
+ *
30
+ * return <div>{profile()?.name}</div>
31
+ * }
32
+ * ```
33
+ */
34
+ export function createCheck(effect, deps) {
35
+ // In dev mode, this just runs createEffect
36
+ // In production, vite-plugin-scenetest strips the entire call
37
+ if (deps) {
38
+ createEffect(on(deps, effect));
39
+ }
40
+ else {
41
+ createEffect(effect);
42
+ }
43
+ }
44
+ //# sourceMappingURL=primitives.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitives.js","sourceRoot":"","sources":["../src/primitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,EAAE,EAAiB,MAAM,UAAU,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAU,WAAW,CACzB,MAAkB,EAClB,IAA0B;IAE1B,2CAA2C;IAC3C,8DAA8D;IAC9D,IAAI,IAAI,EAAE,CAAC;QACT,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAA;IAChC,CAAC;SAAM,CAAC;QACN,YAAY,CAAC,MAAM,CAAC,CAAA;IACtB,CAAC;AACH,CAAC"}
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@scenetest/checks-solid",
3
+ "version": "0.1.0",
4
+ "description": "Solid bindings for scenetest inline assertions",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/scenetest/scenetest-js",
10
+ "directory": "packages/checks-solid"
11
+ },
12
+ "keywords": [
13
+ "testing",
14
+ "e2e",
15
+ "playwright",
16
+ "solid",
17
+ "solidjs",
18
+ "assertions",
19
+ "inline-assertions"
20
+ ],
21
+ "main": "./dist/index.js",
22
+ "types": "./dist/index.d.ts",
23
+ "exports": {
24
+ ".": {
25
+ "types": "./dist/index.d.ts",
26
+ "import": "./dist/index.js"
27
+ }
28
+ },
29
+ "files": [
30
+ "dist"
31
+ ],
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "dependencies": {
36
+ "@scenetest/checks": "0.1.0"
37
+ },
38
+ "peerDependencies": {
39
+ "solid-js": "^1.8.0"
40
+ },
41
+ "devDependencies": {
42
+ "solid-js": "^1.9.11",
43
+ "typescript": "^5.3.3"
44
+ },
45
+ "scripts": {
46
+ "build": "tsc",
47
+ "typecheck": "tsc --noEmit"
48
+ }
49
+ }