Skip to content

Commit 3fd050c

Browse files
author
georgiy.rusanov
committed
try to create a structure for the tests
1 parent c853ea3 commit 3fd050c

File tree

7 files changed

+14
-15
lines changed

7 files changed

+14
-15
lines changed

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,12 @@
3131
"test": "run-s test:types test:run",
3232
"test:all": "run-s test:types test:run test:integration test:integration:browser",
3333
"test:run": "jest --runInBand --detectOpenHandles",
34+
"test:unit": "jest --runInBand --detectOpenHandles test/unit",
3435
"test:coverage": "jest --runInBand --coverage --testPathIgnorePatterns=\"test/integration.*|test/deno.*\"",
3536
"test:integration": "jest --runInBand --detectOpenHandles test/integration.test.ts",
3637
"test:integration:browser": "deno test --allow-all test/integration.browser.test.ts",
37-
"test:db": "cd infra/db && docker-compose down && docker-compose up -d && sleep 5",
3838
"test:watch": "jest --watch --verbose false --silent false",
39-
"test:clean": "cd infra/db && docker-compose down",
40-
"test:types": "run-s build:module && tsd --files test/*.test-d.ts",
39+
"test:types": "run-s build:module && tsd --files test/types/*.test-d.ts",
4140
"docs": "typedoc --entryPoints src/index.ts --out docs/v2 --includes src/**/*.ts",
4241
"docs:json": "typedoc --entryPoints src/index.ts --includes src/**/*.ts --json docs/v2/spec.json --excludeExternals",
4342
"serve:coverage": "npm run test:coverage && serve test/coverage"

test/index.test-d.ts renamed to test/types/index.test-d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expectError, expectType } from 'tsd'
2-
import { PostgrestSingleResponse, createClient } from '../src/index'
3-
import { Database, Json } from './types'
2+
import { PostgrestSingleResponse, createClient } from '../../src/index'
3+
import { Database, Json } from '../types'
44

55
const URL = 'http://localhost:3000'
66
const KEY = 'some.fake.key'

test/SupabaseAuthClient.test.ts renamed to test/unit/SupabaseAuthClient.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { SupabaseAuthClient } from '../src/lib/SupabaseAuthClient'
2-
import SupabaseClient from '../src/SupabaseClient'
3-
import { DEFAULT_HEADERS } from '../src/lib/constants'
1+
import { SupabaseAuthClient } from '../../src/lib/SupabaseAuthClient'
2+
import SupabaseClient from '../../src/SupabaseClient'
3+
import { DEFAULT_HEADERS } from '../../src/lib/constants'
44

55
const DEFAULT_OPTIONS = {
66
auth: {

test/SupabaseClient.test.ts renamed to test/unit/SupabaseClient.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { PostgrestClient } from '@supabase/postgrest-js'
2-
import { createClient, SupabaseClient } from '../src/index'
3-
import { Database } from './types'
2+
import { createClient, SupabaseClient } from '../../src/index'
3+
import { Database } from '../types'
44

55
const URL = 'http://localhost:3000'
66
const KEY = 'some.fake.key'

test/constants.test.ts renamed to test/unit/constants.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { DEFAULT_HEADERS } from '../src/lib/constants'
2-
import { version } from '../src/lib/version'
1+
import { DEFAULT_HEADERS } from '../../src/lib/constants'
2+
import { version } from '../../src/lib/version'
33

44
test('it has the correct type of returning with the correct value', () => {
55
let JS_ENV = ''

test/helper.test.ts renamed to test/unit/helper.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ensureTrailingSlash } from '../src/lib/helpers'
1+
import { ensureTrailingSlash } from '../../src/lib/helpers'
22

33
test('Adds trailing slash to URL if missing', () => {
44
const input = 'http://localhost:3000'

test/helpers.test.ts renamed to test/unit/helpers.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as helpers from '../src/lib/helpers'
2-
import { DEFAULT_HEADERS } from '../src/lib/constants'
1+
import * as helpers from '../../src/lib/helpers'
2+
import { DEFAULT_HEADERS } from '../../src/lib/constants'
33

44
test('uuid', async () => {
55
expect(helpers.uuid()).toMatch(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/)

0 commit comments

Comments
 (0)