Skip to content
Source
Sign inSign up
TanStack/router

test: pin known compiler bugs as expected failures #8630

OpenSheraff(GitHub profile, opens in a new tab)wants to merge 67 commits intomain fromtest/known-compiler-bugsopened

Showing 13 changed files with 111 additions and 0 deletions (loading 12).

x
0 of 13 viewed, 13 left
111 additions and 0 deletionspackages/react-start-rsc/tests/rscCssTransform.test.tsxModified
View file
@@ -1,3 +1,4 @@
+import { transformWithOxc } from 'vite'
import { describe, expect, test } from 'vitest'
import {
StartCompiler,
@@ -213,3 +214,113 @@
expect(code).not.toContain('loadCss')
+​
+// Each test asserts correct behaviour for a bug on main and is marked .fails;
+// remove .fails when the bug is fixed.
+describe('known bugs', () => {
+ const dataUrl = (code: string) =>
+ `data:text/javascript,${encodeURIComponent(code)}`
+​
+ /**
+ * Compiles `code` with `loadCss()` as the CSS expression and evaluates it:
+ * JSX becomes `{ type, children }` trees, components are called (`Card`
+ * renders `card`) and the RSC render APIs return the arguments they are
+ * called with (`renderServerComponent`, which is async, resolves to them).
+ */
+ async function evaluateCompiled(code: string) {
+ const compiled = await compileWithRscCssTransform({
+ code,
+ loadCssExpression: 'loadCss()',