MCPcopy
hub / github.com/livebud/bud / TestSSR

Function TestSSR

package/svelte/compiler_test.go:12–22  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestSSR(t *testing.T) {
13 is := is.New(t)
14 vm, err := v8.Load()
15 is.NoErr(err)
16 compiler, err := svelte.Load(vm)
17 is.NoErr(err)
18 ssr, err := compiler.SSR("test.svelte", []byte(`<h1>hi world!</h1>`))
19 is.NoErr(err)
20 is.True(strings.Contains(ssr.JS, `import { create_ssr_component } from "svelte/internal";`))
21 is.True(strings.Contains(ssr.JS, `<h1>hi world!</h1>`))
22}
23
24func TestSSRRecovery(t *testing.T) {
25 is := is.New(t)

Callers

nothing calls this directly

Calls 6

NewFunction · 0.92
LoadFunction · 0.92
LoadFunction · 0.92
NoErrMethod · 0.80
SSRMethod · 0.80
TrueMethod · 0.80

Tested by

no test coverage detected