mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-25 16:03:13 +00:00
Begin moving files to proper extension and adding tests
This commit is contained in:
parent
6949c7ad73
commit
0cb8fd4216
@ -1,10 +0,0 @@
|
||||
// test/my-module.test.js
|
||||
import assert from 'node:assert'
|
||||
import { describe, it } from 'node:test'
|
||||
import { Client } from 'pg'
|
||||
|
||||
describe('executeQuery', () => {
|
||||
it('should return a non-empty result for a valid query', async () => {
|
||||
assert.ok(true, 'hi')
|
||||
})
|
||||
})
|
||||
@ -14,7 +14,9 @@
|
||||
"test"
|
||||
],
|
||||
"dependencies": {
|
||||
"pg": "^8.14.1"
|
||||
"pg": "^8.14.1",
|
||||
"pg-pool": "^3.8.0",
|
||||
"pg-native": "^3.3.0"
|
||||
},
|
||||
"author": "Brian M. Carlson <brian.m.carlson@gmail.com>",
|
||||
"license": "MIT"
|
||||
|
||||
10
packages/pg-esm-test/pg-native.test.js
Normal file
10
packages/pg-esm-test/pg-native.test.js
Normal file
@ -0,0 +1,10 @@
|
||||
// test/my-module.test.js
|
||||
import assert from 'node:assert'
|
||||
import { describe, it } from 'node:test'
|
||||
import Client from 'pg-native'
|
||||
|
||||
describe('pg-native', () => {
|
||||
it('should export Client constructor', () => {
|
||||
assert.ok(new Client())
|
||||
})
|
||||
})
|
||||
10
packages/pg-esm-test/pg-pool.test.js
Normal file
10
packages/pg-esm-test/pg-pool.test.js
Normal file
@ -0,0 +1,10 @@
|
||||
// test/my-module.test.js
|
||||
import assert from 'node:assert'
|
||||
import { describe, it } from 'node:test'
|
||||
import Pool from 'pg-pool'
|
||||
|
||||
describe('pg-pool', () => {
|
||||
it('should export Pool constructor', () => {
|
||||
assert.ok(new Pool())
|
||||
})
|
||||
})
|
||||
18
packages/pg-esm-test/pg.test.js
Normal file
18
packages/pg-esm-test/pg.test.js
Normal file
@ -0,0 +1,18 @@
|
||||
// test/my-module.test.js
|
||||
import assert from 'node:assert'
|
||||
import { describe, it } from 'node:test'
|
||||
import pg, { Client, Pool } from 'pg'
|
||||
|
||||
describe('pg', () => {
|
||||
it('should export Client constructor', () => {
|
||||
assert.ok(new Client())
|
||||
})
|
||||
|
||||
it('should export Pool constructor', () => {
|
||||
assert.ok(new Pool())
|
||||
})
|
||||
|
||||
it('should still provide default export', () => {
|
||||
assert.ok(new pg.Pool())
|
||||
})
|
||||
})
|
||||
@ -5,7 +5,7 @@
|
||||
"main": "index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./esm/index.js",
|
||||
"import": "./esm/index.mjs",
|
||||
"require": "./index.js",
|
||||
"default": "./index.js"
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
"main": "index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./esm/index.js",
|
||||
"import": "./esm/index.mjs",
|
||||
"require": "./index.js",
|
||||
"default": "./index.js"
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
"main": "./lib",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./esm/index.js",
|
||||
"import": "./esm/index.mjs",
|
||||
"require": "./lib/index.js",
|
||||
"default": "./lib/index.js"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user