René's URL Explorer Experiment


Title: test: add automated test suite (Vitest) for the SQL import/render pipeline by albertoarena · Pull Request #8 · stackrender/stackrender · GitHub

Open Graph Title: test: add automated test suite (Vitest) for the SQL import/render pipeline by albertoarena · Pull Request #8 · stackrender/stackrender

X Title: test: add automated test suite (Vitest) for the SQL import/render pipeline by albertoarena · Pull Request #8 · stackrender/stackrender

Description: What Adds the first automated test suite to StackRender. There is currently no test runner, no test script and no CI, so this lands the harness plus a meaningful suite covering the core SQL import/export pipeline across all six dialects. 88 tests, all green (npm test). One commit per phase for easy review. Why The SQL import and render code is pure, dialect-heavy and the most bug-prone part of the app. It is also the cheapest to test (no DOM, no WASM SQLite, no PowerSync). This suite locks in current behavior and gives a safety net for future dialect work. Tooling Vitest 2.x (matches Vite 5), near-zero config. Standalone vitest.config.ts (node environment, vite-tsconfig-paths for the @/ alias). It does not reuse the app Vite config, so the Tailwind/React/WASM plugins are not pulled into pure-logic tests. New scripts: test (vitest run) and test:watch. What is covered Phase 1, pure helpers: getNextSequence / cloneField, the charset/collation and SQLite integer-column reordering plus enum naming in render-uttils.ts, and orderTables including the CircularDependencyError cycle path behind the Foreign Key Cycle Detection feature. Phase 2, SQL import: getImporter().parseSql for MySQL, MariaDB, PostgreSQL, SQLite, Oracle and SQL Server. Representative CREATE TABLE + foreign key + index fixtures assert table/column counts, primary key, NOT NULL, UNIQUE, DEFAULT, type mapping and the captured foreign key. Also parses the bundled PostgreSQL dump and checks malformed input surfaces errors without dropping valid tables. Phase 3, SQL render: getRenderer().renderDDL for all six dialects from a shared DatabaseType fixture, asserting the emitted DDL creates both tables and carries the primary key, unique constraint, dialect-specific auto-increment spelling (AUTO_INCREMENT / SERIAL / AUTOINCREMENT / IDENTITY), length-carrying text type, DEFAULT and the foreign key with ON DELETE CASCADE. Phase 4, round-trip: parse DDL to model, render it back, parse again and assert the two models are equal (normalized on names, resolved types, key/constraint flags and relationships, not raw SQL). This is the strongest integration check of the pipeline. Data-type fixtures are built from the seed arrays via the same transform the app uses in seedDataTypes, so tests run without booting the WASM SQLite database. Notes for reviewers The parser (@guanmingchiu/sqlparser-ts) init() is async and the importer constructor does not await it (correct in the browser, where it resolves before any import). The suite awaits init() once in beforeAll. The round-trip canonicalizes primary keys to non-nullable in its comparison. SQL Server renders the primary key as a table-level constraint, and the importer only forces NOT NULL for inline primary keys, so the flag would otherwise differ on the round trip although the schemas are equivalent. This looks like a small importer asymmetry worth a follow-up. CI (.github/workflows/ci.yml) runs npm ci + npm test on pushes to main and on pull requests. Typecheck and lint are intentionally left out for now: the current codebase does not pass a strict project typecheck or a clean lint, so gating on them would fail CI on pre-existing, unrelated issues. Happy to add them in a separate cleanup PR. Verifying npm install npm test

Open Graph Description: What Adds the first automated test suite to StackRender. There is currently no test runner, no test script and no CI, so this lands the harness plus a meaningful suite covering the core SQL import/...

X Description: What Adds the first automated test suite to StackRender. There is currently no test runner, no test script and no CI, so this lands the harness plus a meaningful suite covering the core SQL import/...

Opengraph URL: https://github.com/stackrender/stackrender/pull/8

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.4

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:f1931476-8cf4-c016-407f-4db6ed013ab6
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC69E:2ADD62:12A6D5F:17CCCCB:6B02FB31
html-safe-nonced0b1687562eba470eb14e5b961b50f175115267197b31c4195f187bdb0ebf8a0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNjlFOjJBREQ2MjoxMkE2RDVGOjE3Q0NDQ0I6NkIwMkZCMzEiLCJ2aXNpdG9yX2lkIjoiODgxNjA5MDQzMDM4ODIzOTE1MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac2a36ed91c2786105fa3f0a5d867a8b7424462e77f548993077af3f88024d245a
hovercard-subject-tagpull_request:4209733305
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/stackrender/stackrender/pull/8/files
twitter:imagehttps://avatars.githubusercontent.com/u/1126630?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1126630?s=400&v=4
og:image:altWhat Adds the first automated test suite to StackRender. There is currently no test runner, no test script and no CI, so this lands the harness plus a meaningful suite covering the core SQL import/...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/stackrender/stackrender git https://github.com/stackrender/stackrender.git
octolytics-dimension-user_id226551349
octolytics-dimension-user_loginstackrender
octolytics-dimension-repository_id977671574
octolytics-dimension-repository_nwostackrender/stackrender
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id977671574
octolytics-dimension-repository_network_root_nwostackrender/stackrender
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/stackrender/stackrender/pull/8/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fstackrender%2Fstackrender%2Fpull%2F8%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fstackrender%2Fstackrender%2Fpull%2F8%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=stackrender%2Fstackrender
Reloadhttps://github.com/stackrender/stackrender/pull/8/files
Reloadhttps://github.com/stackrender/stackrender/pull/8/files
Reloadhttps://github.com/stackrender/stackrender/pull/8/files
stackrenderhttps://github.com/stackrender
stackrenderhttps://github.com/stackrender/stackrender
Codehttps://github.com/stackrender/stackrender
Issueshttps://github.com/stackrender/stackrender/issues
Pull requestshttps://github.com/stackrender/stackrender/pulls
Actionshttps://github.com/stackrender/stackrender/actions
Projectshttps://github.com/stackrender/stackrender/projects
Security and qualityhttps://github.com/stackrender/stackrender/security
Insightshttps://github.com/stackrender/stackrender/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fstackrender%2Fstackrender%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fstackrender%2Fstackrender%2Fissues%2Fnew%2Fchoose
KarimTamanihttps://github.com/KarimTamani
stackrender:mainhttps://github.com/stackrender/stackrender/tree/main
albertoarena:test/automated-testshttps://github.com/albertoarena/stackrender/tree/test/automated-tests
Conversation 2 https://github.com/stackrender/stackrender/pull/8
Commits 4 https://github.com/stackrender/stackrender/pull/8/commits
Checks 0 https://github.com/stackrender/stackrender/pull/8/checks
Files changed https://github.com/stackrender/stackrender/pull/8/files
Please reload this pagehttps://github.com/stackrender/stackrender/pull/8/files
test: add automated test suite (Vitest) for the SQL import/render pipeline https://github.com/stackrender/stackrender/pull/8/files#top
Show all changes 4 commits https://github.com/stackrender/stackrender/pull/8/files
d0cd2d8 test: add Vitest and Phase 1 pure-helper suite albertoarena Aug 5, 2026 https://github.com/stackrender/stackrender/pull/8/commits/d0cd2d8fa4ce14b8bfdd3fc82feb57d2e864c597
585f5c7 test: add Phase 2 SQL import tests for all dialects albertoarena Aug 5, 2026 https://github.com/stackrender/stackrender/pull/8/commits/585f5c7a7ffa9964aa2dc0458fa8b909bc33a3b0
91fe5d6 test: add Phase 3 SQL render tests for all dialects albertoarena Aug 5, 2026 https://github.com/stackrender/stackrender/pull/8/commits/91fe5d6cf2d44c3e13f09275cb4c722ca7b77afc
42e2bcf test: add round-trip tests and CI workflow albertoarena Aug 5, 2026 https://github.com/stackrender/stackrender/pull/8/commits/42e2bcf5e976db006236d382614a7e469bdfffe8
Clear filters https://github.com/stackrender/stackrender/pull/8/files
Please reload this pagehttps://github.com/stackrender/stackrender/pull/8/files
Please reload this pagehttps://github.com/stackrender/stackrender/pull/8/files
ci.yml https://github.com/stackrender/stackrender/pull/8/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03f
package-lock.json https://github.com/stackrender/stackrender/pull/8/files#diff-053150b640a7ce75eff69d1a22cae7f0f94ad64ce9a855db544dda0929316519
package.json https://github.com/stackrender/stackrender/pull/8/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519
data-types.ts https://github.com/stackrender/stackrender/pull/8/files#diff-41ece112702cb2920c4dabba2f3334965b24e3e11c38973eab6b90e6a1c61836
database.ts https://github.com/stackrender/stackrender/pull/8/files#diff-4c940cbd880cb4f10854047eacf75330f5465b7ec73c8d97f466bec8231ab77b
field.test.ts https://github.com/stackrender/stackrender/pull/8/files#diff-01aa66253817007d20737d178ea8828df6c8dbc7fc7eeed0895265808de71049
import.test.ts https://github.com/stackrender/stackrender/pull/8/files#diff-6fe661c7e1f0aa4038085ff9b75f738203f938e3159a3ae3696c3cfbd806fa6f
render-uttils.test.ts https://github.com/stackrender/stackrender/pull/8/files#diff-ecf9e2a3dc2a6f7633a186eaa4bdc9215ac185b491df4e381d300bf1a5630faa
render.test.ts https://github.com/stackrender/stackrender/pull/8/files#diff-80231cdcbe6fabda65bab37c7ab6eca7e6a32239058b877d9949f09b0635a857
round-trip.test.ts https://github.com/stackrender/stackrender/pull/8/files#diff-ea16509282340100c47f68fc643db8a487f54add29278f92d68aad17bebe730d
tables.test.ts https://github.com/stackrender/stackrender/pull/8/files#diff-6e47cd8e983d875ab4b8539dc53e19950f7f1e1d239df5f1a75c97a7372c95ea
tsconfig.node.json https://github.com/stackrender/stackrender/pull/8/files#diff-fe25c5935d7e03a4c85624008426c631b83d3afccbd792e41549cb74ce945118
vitest.config.ts https://github.com/stackrender/stackrender/pull/8/files#diff-2ee894bf23aa44ff4ce12a3da8af19ab20180474ebf2176dbe5f2eea3f96dc92
.github/workflows/ci.ymlhttps://github.com/stackrender/stackrender/pull/8/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03f
View file https://github.com/albertoarena/stackrender/blob/42e2bcf5e976db006236d382614a7e469bdfffe8/.github/workflows/ci.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/stackrender/stackrender/pull/8/{{ revealButtonHref }}
Please reload this pagehttps://github.com/stackrender/stackrender/pull/8/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.