diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 342e3a59..22c619cd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -317,8 +317,6 @@ jobs: permissions: contents: 'read' id-token: 'write' - issues: write - pull-requests: write runs-on: ${{ matrix.os }} @@ -412,5 +410,5 @@ jobs: SQLSERVER_PASS: '${{ steps.secrets.outputs.SQLSERVER_PASS }}' SQLSERVER_DB: '${{ steps.secrets.outputs.SQLSERVER_DB }}' if: "${{ matrix.node-version != 'v14.x' }}" - run: npx tap -c -t0 --disable-coverage --allow-empty-coverage examples/*/{mysql2,pg,tedious}.test{.cjs,.mjs,.ts} -o test_results.tap + run: npx tap -c -t0 --disable-coverage --allow-empty-coverage examples/*/{mysql2,pg,tedious}/*.test{.cjs,.mjs,.ts} -o test_results.tap timeout-minutes: 5 diff --git a/examples/README.md b/examples/README.md index 93f3381f..69302368 100644 --- a/examples/README.md +++ b/examples/README.md @@ -8,12 +8,12 @@ some of the most popular database libraries and frameworks. ### TypeORM -- [MySQL (CommonJS)](./typeorm/mysql2.cjs) -- [MySQL (ESM)](./typeorm/mysql2.mjs) -- [MySQL (TypeScript)](./typeorm/mysql2.ts) -- [PostgreSQL (CommonJS)](./typeorm/pg.cjs) -- [PostgreSQL (ESM)](./typeorm/pg.mjs) -- [PostgreSQL (TypeScript)](./typeorm/pg.ts) -- [SQL Server (CommonJS)](./typeorm/tedious.cjs) -- [SQL Server (ESM)](./typeorm/tedious.mjs) -- [SQL Server (TypeScript)](./typeorm/tedious.ts) +- [MySQL (CommonJS)](./typeorm/mysql2/connect.cjs) +- [MySQL (ESM)](./typeorm/mysql2/connect.mjs) +- [MySQL (TypeScript)](./typeorm/mysql2/connect.ts) +- [PostgreSQL (CommonJS)](./typeorm/pg/connect.cjs) +- [PostgreSQL (ESM)](./typeorm/pg/connect.mjs) +- [PostgreSQL (TypeScript)](./typeorm/pg/connect.ts) +- [SQL Server (CommonJS)](./typeorm/tedious/connect.cjs) +- [SQL Server (ESM)](./typeorm/tedious/connect.mjs) +- [SQL Server (TypeScript)](./typeorm/tedious/connect.ts) diff --git a/examples/typeorm/mysql2.cjs b/examples/typeorm/mysql2/connect.cjs similarity index 100% rename from examples/typeorm/mysql2.cjs rename to examples/typeorm/mysql2/connect.cjs diff --git a/examples/typeorm/mysql2.mjs b/examples/typeorm/mysql2/connect.mjs similarity index 100% rename from examples/typeorm/mysql2.mjs rename to examples/typeorm/mysql2/connect.mjs diff --git a/examples/typeorm/mysql2.test.cjs b/examples/typeorm/mysql2/connect.test.cjs similarity index 82% rename from examples/typeorm/mysql2.test.cjs rename to examples/typeorm/mysql2/connect.test.cjs index 838281d8..7b6ad55f 100644 --- a/examples/typeorm/mysql2.test.cjs +++ b/examples/typeorm/mysql2/connect.test.cjs @@ -13,7 +13,7 @@ // limitations under the License. const t = require('tap'); -const connector = require('./mysql2.cjs'); +const connector = require('./connect.cjs'); t.test('mysql2 typeorm cjs', async t => { const { dataSource, close } = await connector.connect({ @@ -21,8 +21,8 @@ t.test('mysql2 typeorm cjs', async t => { username: process.env.MYSQL_IAM_USER, database: process.env.MYSQL_DB, }); - const [{ now: time }] = await dataSource.manager.query('SELECT NOW() as now') - t.ok(time.getTime(), 'should have valid returned date object'); + const [{ now }] = await dataSource.manager.query('SELECT NOW() as now') + t.ok(now.getTime(), 'should have valid returned date object'); await close(); }); diff --git a/examples/typeorm/mysql2.test.mjs b/examples/typeorm/mysql2/connect.test.mjs similarity index 82% rename from examples/typeorm/mysql2.test.mjs rename to examples/typeorm/mysql2/connect.test.mjs index 7521e5c4..bbd86b22 100644 --- a/examples/typeorm/mysql2.test.mjs +++ b/examples/typeorm/mysql2/connect.test.mjs @@ -13,7 +13,7 @@ // limitations under the License. import t from 'tap'; -import {connect} from './mysql2.mjs'; +import {connect} from './connect.mjs'; t.test('mysql2 typeorm mjs', async t => { const { dataSource, close } = await connect({ @@ -21,7 +21,7 @@ t.test('mysql2 typeorm mjs', async t => { username: process.env.MYSQL_IAM_USER, database: process.env.MYSQL_DB, }); - const [{ now: time }] = await dataSource.manager.query('SELECT NOW() as now'); - t.ok(time.getTime(), 'should have valid returned date object'); + const [{ now }] = await dataSource.manager.query('SELECT NOW() as now'); + t.ok(now.getTime(), 'should have valid returned date object'); await close(); }); diff --git a/examples/typeorm/mysql2.test.ts b/examples/typeorm/mysql2/connect.test.ts similarity index 82% rename from examples/typeorm/mysql2.test.ts rename to examples/typeorm/mysql2/connect.test.ts index 863389a4..d41af178 100644 --- a/examples/typeorm/mysql2.test.ts +++ b/examples/typeorm/mysql2/connect.test.ts @@ -13,7 +13,7 @@ // limitations under the License. import t from 'tap'; -import {connect} from './mysql2'; +import {connect} from './connect'; t.test('mysql typeorm ts', async t => { const {dataSource, close} = await connect({ @@ -21,7 +21,7 @@ t.test('mysql typeorm ts', async t => { username: process.env.MYSQL_IAM_USER, database: process.env.MYSQL_DB, }); - const [{now: time}] = await dataSource.manager.query('SELECT NOW() as now'); - t.ok(time.getTime(), 'should have valid returned date object'); + const [{now}] = await dataSource.manager.query('SELECT NOW() as now'); + t.ok(now.getTime(), 'should have valid returned date object'); await close(); }); diff --git a/examples/typeorm/mysql2.ts b/examples/typeorm/mysql2/connect.ts similarity index 100% rename from examples/typeorm/mysql2.ts rename to examples/typeorm/mysql2/connect.ts diff --git a/examples/typeorm/pg.cjs b/examples/typeorm/pg/connect.cjs similarity index 100% rename from examples/typeorm/pg.cjs rename to examples/typeorm/pg/connect.cjs diff --git a/examples/typeorm/pg.mjs b/examples/typeorm/pg/connect.mjs similarity index 100% rename from examples/typeorm/pg.mjs rename to examples/typeorm/pg/connect.mjs diff --git a/examples/typeorm/pg.test.cjs b/examples/typeorm/pg/connect.test.cjs similarity index 82% rename from examples/typeorm/pg.test.cjs rename to examples/typeorm/pg/connect.test.cjs index dd1cb236..d0c3d05b 100644 --- a/examples/typeorm/pg.test.cjs +++ b/examples/typeorm/pg/connect.test.cjs @@ -13,7 +13,7 @@ // limitations under the License. const t = require('tap'); -const connector = require('./pg.cjs'); +const connector = require('./connect.cjs'); t.test('pg typeorm cjs', async t => { const { dataSource, close } = await connector.connect({ @@ -21,7 +21,7 @@ t.test('pg typeorm cjs', async t => { username: process.env.POSTGRES_IAM_USER, database: process.env.POSTGRES_DB, }); - const [{ now: time }] = await dataSource.manager.query('SELECT NOW() as now') - t.ok(time.getTime(), 'should have valid returned date object'); + const [{ now }] = await dataSource.manager.query('SELECT NOW() as now') + t.ok(now.getTime(), 'should have valid returned date object'); await close(); }); diff --git a/examples/typeorm/pg.test.mjs b/examples/typeorm/pg/connect.test.mjs similarity index 82% rename from examples/typeorm/pg.test.mjs rename to examples/typeorm/pg/connect.test.mjs index 079e3ae1..3455a16e 100644 --- a/examples/typeorm/pg.test.mjs +++ b/examples/typeorm/pg/connect.test.mjs @@ -13,7 +13,7 @@ // limitations under the License. import t from 'tap'; -import {connect} from './pg.mjs'; +import {connect} from './connect.mjs'; t.test('pg typeorm mjs', async t => { const { dataSource, close } = await connect({ @@ -21,7 +21,7 @@ t.test('pg typeorm mjs', async t => { username: process.env.POSTGRES_IAM_USER, database: process.env.POSTGRES_DB, }); - const [{ now: time }] = await dataSource.manager.query('SELECT NOW() as now'); - t.ok(time.getTime(), 'should have valid returned date object'); + const [{ now }] = await dataSource.manager.query('SELECT NOW() as now'); + t.ok(now.getTime(), 'should have valid returned date object'); await close(); }); diff --git a/examples/typeorm/pg.test.ts b/examples/typeorm/pg/connect.test.ts similarity index 83% rename from examples/typeorm/pg.test.ts rename to examples/typeorm/pg/connect.test.ts index b2f07e04..5366a0d5 100644 --- a/examples/typeorm/pg.test.ts +++ b/examples/typeorm/pg/connect.test.ts @@ -13,7 +13,7 @@ // limitations under the License. import t from 'tap'; -import {connect} from './pg'; +import {connect} from './connect'; t.test('pg typeorm ts', async t => { const {dataSource, close} = await connect({ @@ -21,7 +21,7 @@ t.test('pg typeorm ts', async t => { username: process.env.POSTGRES_IAM_USER, database: process.env.POSTGRES_DB, }); - const [{now: time}] = await dataSource.manager.query('SELECT NOW() as now'); - t.ok(time.getTime(), 'should have valid returned date object'); + const [{now}] = await dataSource.manager.query('SELECT NOW() as now'); + t.ok(now.getTime(), 'should have valid returned date object'); await close(); }); diff --git a/examples/typeorm/pg.ts b/examples/typeorm/pg/connect.ts similarity index 100% rename from examples/typeorm/pg.ts rename to examples/typeorm/pg/connect.ts diff --git a/examples/typeorm/tedious.cjs b/examples/typeorm/tedious/connect.cjs similarity index 100% rename from examples/typeorm/tedious.cjs rename to examples/typeorm/tedious/connect.cjs diff --git a/examples/typeorm/tedious.mjs b/examples/typeorm/tedious/connect.mjs similarity index 100% rename from examples/typeorm/tedious.mjs rename to examples/typeorm/tedious/connect.mjs diff --git a/examples/typeorm/tedious.test.cjs b/examples/typeorm/tedious/connect.test.cjs similarity index 82% rename from examples/typeorm/tedious.test.cjs rename to examples/typeorm/tedious/connect.test.cjs index f9957ab9..2e25d340 100644 --- a/examples/typeorm/tedious.test.cjs +++ b/examples/typeorm/tedious/connect.test.cjs @@ -13,7 +13,7 @@ // limitations under the License. const t = require('tap'); -const connector = require('./tedious.cjs'); +const connector = require('./connect.cjs'); t.test('tedious typeorm cjs', async t => { const { dataSource, close } = await connector.connect({ @@ -22,7 +22,7 @@ t.test('tedious typeorm cjs', async t => { password: process.env.SQLSERVER_PASS, database: process.env.SQLSERVER_DB, }); - const [{ now: time }] = await dataSource.manager.query('SELECT GETUTCDATE() as now') - t.ok(time.getTime(), 'should have valid returned date object'); + const [{ now }] = await dataSource.manager.query('SELECT GETUTCDATE() as now') + t.ok(now.getTime(), 'should have valid returned date object'); await close(); }); diff --git a/examples/typeorm/tedious.test.mjs b/examples/typeorm/tedious/connect.test.mjs similarity index 82% rename from examples/typeorm/tedious.test.mjs rename to examples/typeorm/tedious/connect.test.mjs index 7e6cf129..1491031b 100644 --- a/examples/typeorm/tedious.test.mjs +++ b/examples/typeorm/tedious/connect.test.mjs @@ -13,7 +13,7 @@ // limitations under the License. import t from 'tap'; -import {connect} from './tedious.mjs'; +import {connect} from './connect.mjs'; t.test('tedious typeorm mjs', async t => { const { dataSource, close } = await connect({ @@ -22,7 +22,7 @@ t.test('tedious typeorm mjs', async t => { password: process.env.SQLSERVER_PASS, database: process.env.SQLSERVER_DB, }); - const [{ now: time }] = await dataSource.manager.query('SELECT GETUTCDATE() as now') - t.ok(time.getTime(), 'should have valid returned date object'); + const [{ now }] = await dataSource.manager.query('SELECT GETUTCDATE() as now') + t.ok(now.getTime(), 'should have valid returned date object'); await close(); }); diff --git a/examples/typeorm/tedious.test.ts b/examples/typeorm/tedious/connect.test.ts similarity index 82% rename from examples/typeorm/tedious.test.ts rename to examples/typeorm/tedious/connect.test.ts index 78f069fb..8f8b018e 100644 --- a/examples/typeorm/tedious.test.ts +++ b/examples/typeorm/tedious/connect.test.ts @@ -13,7 +13,7 @@ // limitations under the License. import t from 'tap'; -import {connect} from './tedious'; +import {connect} from './connect'; t.test('tedious typeorm ts', async t => { const {dataSource, close} = await connect({ @@ -22,9 +22,7 @@ t.test('tedious typeorm ts', async t => { password: process.env.SQLSERVER_PASS, database: process.env.SQLSERVER_DB, }); - const [{now: time}] = await dataSource.manager.query( - 'SELECT GETUTCDATE() as now' - ); - t.ok(time.getTime(), 'should have valid returned date object'); + const [{now}] = await dataSource.manager.query('SELECT GETUTCDATE() as now'); + t.ok(now.getTime(), 'should have valid returned date object'); await close(); }); diff --git a/examples/typeorm/tedious.ts b/examples/typeorm/tedious/connect.ts similarity index 100% rename from examples/typeorm/tedious.ts rename to examples/typeorm/tedious/connect.ts