Integration tests truncate and drop the users table without proving the database is disposable
Source references: 6The guide calls for truncating the table before every test and dropping it afterward. One API example reuses the application's database connection without checking the database name, environment, or production status. A second example names test_db explicitly but performs the same destructive queries.
If application configuration, environment variables, or local credentials point to a shared, development, or production database, running the tests could permanently erase every user record or the entire users table.
The source supports this risk, though these are testing examples to be adopted, not operations already executed by the Skill. The guide requires truncation before tests and teardown afterward; the API example imports the application's pool and then drops/truncates users without checking the environment or database name. If misconfigured to a shared or production database, it could permanently remove the table or its data. Users can ask for a hard test-database guard and verify the connection target and account permissions before running it.
Integration tests verify real database operations and HTTP endpoints using `supertest` and a test database instance. Always truncate tables in `beforeEach` and tear down in `afterAll`.For full API integration test examples (supertest + PostgreSQL) and database repository integration tests, see [references/advanced-testing-patterns.md](references/advanced-testing-patterns.md).Show 5 other places
// tests/integration/user.api.test.tsimport request from "supertest";import { app } from "../../src/app";import { pool } from "../../src/config/database";describe("User API Integration Tests", () => { beforeAll(async () => { // Setup test database await pool.query("CREATE TABLE IF NOT EXISTS users (...)"); }); afterAll(async () => { // Cleanup await pool.query("DROP TABLE IF EXISTS users"); await pool.end(); }); beforeEach(async () => { // Clear data before each test await pool.query("TRUNCATE TABLE users CASCADE"); }); beforeAll(async () => { pool = new Pool({ host: "localhost", port: 5432, database: "test_db", user: "test_user", password: "test_password", });import { app } from "../../src/app";import { pool } from "../../src/config/database"; beforeEach(async () => { // Clear data before each test await pool.query("TRUNCATE TABLE users CASCADE"); });