Repository: typeorm/typeorm
File: test/github-issues/11440/issue-11440.ts (TypeScript)

Code before:
import { expect } from "chai"
import "reflect-metadata"

import { DataSource } from "../../../src"
import {
    closeTestingConnections,
    createTestingConnections,
    reloadTestingDatabases,
} from "../../utils/test-utils"
import { Post } from "./entity/Post"

describe("github issues > #11440", () => {
    let dataSource: DataSource
    before(async () => {
        ;[dataSource] = await createTestingConnections({
            entities: [Post],
            enabledDrivers: ["postgres"], // since the issue is for postgres only
        })
    })
    beforeEach(() => reloadTestingDatabases([dataSource]))
    after(() => closeTestingConnections([dataSource]))

    it("should use table or alias name during upsert or doUpdate when both schema name and skipUpdateIfNoValuesChanged supplied", async () => {
        const repository = dataSource.getRepository(Post)
        await repository.save([
            {
                id: 1,
                title: "First Post",
            },
            {
                id: 2,
                title: "Second Post",
            },
            {
                id: 3,
                title: "Third Post",
            },
        ])

        // upsert does not cast alias as class name
        await repository.upsert(
            [
                {
                    id: 1,
                    title: "First Post",
                },

Review comment (suggestion):
Since you're using `createTestingConnections`, you'll still need to store each data source here and pass the list into `reloadTestingDatabases` and `closeTestingConnections`. Then you'll need to iterate over each datasource in each test.

```suggestion
    let dataSources: DataSource[]
    before(async () => {
        dataSources = await createTestingConnections({
            entities: [Post],
            enabledDrivers: ["postgres"], // since the issue is for postgres only
        })
    })
    beforeEach(() => reloadTestingDatabases(dataSources))
    after(() => closeTestingConnections(dataSources))
```

Alternatively, you can take a look at using `setupSingleTestingConnection`, some tests use that configuration.

Code after:
import { expect } from "chai"
import "reflect-metadata"

import { DataSource } from "../../../src"
import {
    closeTestingConnections,
    createTestingConnections,
    reloadTestingDatabases,
} from "../../utils/test-utils"
import { Post } from "./entity/Post"

describe("github issues > #11440", () => {
    let dataSources: DataSource[]

    before(async () => {
        dataSources = await createTestingConnections({
            entities: [Post],
            enabledDrivers: ["postgres", "aurora-postgres", "cockroachdb"],
        })
    })
    beforeEach(() => reloadTestingDatabases(dataSources))
    after(() => closeTestingConnections(dataSources))

    it("should use table or alias name during upsert or doUpdate when both schema name and skipUpdateIfNoValuesChanged supplied", async () => {
        Promise.all(
            dataSources.map(async (dataSource) => {
                const repository = dataSource.getRepository(Post)
                await repository.save([
                    {
                        id: 1,
                        title: "First Post",
                    },
                    {
                        id: 2,
                        title: "Second Post",
                    },
                    {
                        id: 3,
                        title: "Third Post",
                    },
                ])

                // upsert does not cast alias as class name
                await repository.upsert(
                    [
                        {