diff --git a/package.json b/package.json index a1d04287..07125d02 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,12 @@ "eslint --no-ignore --fix" ] }, + "nyc": { + "extends": "@istanbuljs/nyc-config-typescript", + "include": [ + "src" + ] + }, "dependencies": { "dayjs": "^1.10.3", "debug": "^3.1.0", @@ -101,6 +107,7 @@ "@babel/core": "^7.14.6", "@babel/eslint-parser": "^7.14.7", "@cara/minami": "^1.2.3", + "@istanbuljs/nyc-config-typescript": "^1.0.2", "@journeyapps/sqlcipher": "^5.2.0", "@tsconfig/node16": "^16.1.1", "@types/mocha": "^9.0.0", diff --git a/test/integration/custom.test.js b/test/integration/custom.test.js index 3cae1bfd..8c803030 100644 --- a/test/integration/custom.test.js +++ b/test/integration/custom.test.js @@ -5,7 +5,7 @@ const path = require('path'); const sinon = require('sinon'); const SqlString = require('sqlstring'); -const { connect, raw, Bone, disconnect, Raw, SqliteDriver } = require('../..'); +const { connect, raw, Bone, disconnect, Raw, SqliteDriver } = require('../../src'); const { checkDefinitions } = require('./helpers'); const { formatConditions, collectLiteral } = require('../../src/expr_formatter'); const { findExpr } = require('../../src/expr'); diff --git a/test/integration/helpers/index.js b/test/integration/helpers/index.js index e439abe8..a1b404a2 100644 --- a/test/integration/helpers/index.js +++ b/test/integration/helpers/index.js @@ -1,7 +1,7 @@ 'use strict'; const assert = require('assert').strict; -const { Bone } = require('../../..'); +const { Bone } = require('../../../src'); async function checkDefinitions(table, definitions) { const { database } = Bone.options; diff --git a/test/integration/mysql.test.js b/test/integration/mysql.test.js index af9989d8..fd696922 100644 --- a/test/integration/mysql.test.js +++ b/test/integration/mysql.test.js @@ -4,7 +4,7 @@ const assert = require('assert').strict; const path = require('path'); const dayjs = require('dayjs'); -const { connect } = require('../..'); +const { connect } = require('../../src'); before(async function() { await connect({ diff --git a/test/integration/mysql2.test.js b/test/integration/mysql2.test.js index 91bf56c0..772675f0 100644 --- a/test/integration/mysql2.test.js +++ b/test/integration/mysql2.test.js @@ -1,7 +1,7 @@ 'use strict'; const path = require('path'); -const { connect } = require('../..'); +const { connect } = require('../../src'); before(async function() { await connect({ diff --git a/test/integration/postgres.test.js b/test/integration/postgres.test.js index 0f48c568..6f407f18 100644 --- a/test/integration/postgres.test.js +++ b/test/integration/postgres.test.js @@ -4,7 +4,7 @@ const assert = require('assert').strict; const path = require('path'); const sinon = require('sinon'); -const { connect, raw } = require('../..'); +const { connect, raw } = require('../../src'); before(async function() { await connect({ diff --git a/test/integration/sqlcipher.test.js b/test/integration/sqlcipher.test.js index 3f319914..1ea1a2a2 100644 --- a/test/integration/sqlcipher.test.js +++ b/test/integration/sqlcipher.test.js @@ -3,7 +3,7 @@ const fs = require('fs').promises; const path = require('path'); const sqlcipher = require('@journeyapps/sqlcipher'); -const Realm = require('../..'); +const Realm = require('../../src'); before(async function() { const plaintext = '/tmp/leoric.sqlite3'; diff --git a/test/integration/sqlite.test.js b/test/integration/sqlite.test.js index 1a648183..6d61d8ef 100644 --- a/test/integration/sqlite.test.js +++ b/test/integration/sqlite.test.js @@ -4,7 +4,7 @@ const assert = require('assert').strict; const path = require('path'); const sinon = require('sinon'); -const { connect, raw, Bone } = require('../..'); +const { connect, raw, Bone } = require('../../src'); const { checkDefinitions } = require('./helpers'); before(async function() { diff --git a/test/integration/sqljs.test.js b/test/integration/sqljs.test.js index 2bbe2cd1..1bdd6d2c 100644 --- a/test/integration/sqljs.test.js +++ b/test/integration/sqljs.test.js @@ -5,7 +5,7 @@ const path = require('path'); const fs = require('fs').promises; const sinon = require('sinon'); -const Realm = require('../..'); +const Realm = require('../../src'); const { checkDefinitions } = require('./helpers'); const { raw, Bone, SqljsDriver } = Realm; diff --git a/test/integration/suite/basics.test.js b/test/integration/suite/basics.test.js index 7b6e97ce..11dfb43f 100644 --- a/test/integration/suite/basics.test.js +++ b/test/integration/suite/basics.test.js @@ -3,7 +3,7 @@ const assert = require('assert').strict; const expect = require('expect.js'); -const { Collection, Bone } = require('../../..'); +const { Collection, Bone } = require('../../../src'); const Book = require('../../models/book'); const Comment = require('../../models/comment'); const Post = require('../../models/post'); diff --git a/test/integration/suite/data_types.test.js b/test/integration/suite/data_types.test.js index ef9e9451..0f80fbde 100644 --- a/test/integration/suite/data_types.test.js +++ b/test/integration/suite/data_types.test.js @@ -3,7 +3,7 @@ const assert = require('assert').strict; const dayjs = require('dayjs'); -const { Bone, DataTypes } = require('../../..'); +const { Bone, DataTypes } = require('../../../src'); const { INTEGER, STRING, DATE, DATEONLY, TEXT, BOOLEAN, JSON, JSONB, BIGINT } = DataTypes; @@ -17,7 +17,7 @@ describe('=> Data types', () => { createdAt: DATE, updatedAt: DATE, publishedAt: DATE(6), - } + }; }; before(async () => { @@ -77,7 +77,7 @@ describe('=> Data types - JSON', () => { publishedAt: DATE(6), meta: JSON, metab: JSONB, - } + }; } before(async () => { @@ -146,7 +146,7 @@ describe('=> Data types - BINARY', () => { meta: BINARY, metab: VARBINARY, metac: BLOB - } + }; } Note = NoteClass; }); @@ -202,7 +202,7 @@ describe('=> Data Types - INTEGER', function() { static attributes = { word_count: INTEGER, createdAt: DATE, - } + }; } before(async function() { @@ -250,7 +250,7 @@ describe('=> Data types - DATE', function() { static attributes = { createdAt: DATE(6), updatedAt: DATE(6), - } + }; } before(async function() { @@ -307,7 +307,7 @@ describe('=> Data types - DATEONLY', function() { class Note extends Bone { static attributes = { createdAt: DATEONLY, - } + }; } before(async function() { @@ -363,7 +363,7 @@ describe('=> Data types - JSON', function() { class Note extends Bone { static attributes = { meta: JSON, - } + }; } before(async () => { @@ -392,7 +392,7 @@ describe('=> Data types - TEXT', function() { class Note extends Bone { static attributes = { meta: TEXT, - } + }; } before(async () => { @@ -426,7 +426,7 @@ describe('=> Data types - STRING', function() { class Note extends Bone { static attributes = { meta: STRING, - } + }; } before(async () => { @@ -461,7 +461,7 @@ describe('=> Data types - complementary', function() { static attributes = { createdAt: DATE, updatedAt: new DATE(3), - } + }; } before(async function() { diff --git a/test/integration/suite/definitions.test.js b/test/integration/suite/definitions.test.js index d18ba2e5..4bfa2592 100644 --- a/test/integration/suite/definitions.test.js +++ b/test/integration/suite/definitions.test.js @@ -2,7 +2,7 @@ const assert = require('assert').strict; const sinon = require('sinon'); -const { Bone, DataTypes } = require('../../..'); +const { Bone, DataTypes } = require('../../../src'); const { checkDefinitions } = require('../helpers'); const { INTEGER, STRING, TEXT } = DataTypes; diff --git a/test/integration/suite/migrations.test.js b/test/integration/suite/migrations.test.js index ad0de74b..975e2dc1 100644 --- a/test/integration/suite/migrations.test.js +++ b/test/integration/suite/migrations.test.js @@ -5,7 +5,7 @@ const fs = require('fs').promises; const path = require('path'); const dayjs = require('dayjs'); -const Realm = require('../../..'); +const Realm = require('../../../src'); const Logger = require('../../../src/drivers/abstract/logger'); const { checkDefinitions } = require('../helpers'); diff --git a/test/integration/suite/querying.test.js b/test/integration/suite/querying.test.js index d7cc0b85..f9abee54 100644 --- a/test/integration/suite/querying.test.js +++ b/test/integration/suite/querying.test.js @@ -4,7 +4,7 @@ const assert = require('assert').strict; const expect = require('expect.js'); const sinon = require('sinon'); -const { raw } = require('../../../'); +const { raw } = require('../../../src'); const Attachment = require('../../models/attachment'); const Book = require('../../models/book'); diff --git a/test/models/attachment.js b/test/models/attachment.js index 03457968..2404489e 100644 --- a/test/models/attachment.js +++ b/test/models/attachment.js @@ -1,6 +1,6 @@ 'use strict'; -const { Bone } = require('../..'); +const { Bone } = require('../../src'); class Attachment extends Bone { static initialize() { diff --git a/test/models/book.js b/test/models/book.js index b1d9f509..fc0d0caa 100644 --- a/test/models/book.js +++ b/test/models/book.js @@ -1,6 +1,6 @@ 'use strict'; -const { Bone } = require('../..'); +const { Bone } = require('../../src'); class Book extends Bone { // static get primaryKey() { diff --git a/test/models/comment.js b/test/models/comment.js index 5a66fcfb..fb7051e8 100644 --- a/test/models/comment.js +++ b/test/models/comment.js @@ -1,6 +1,6 @@ 'use strict'; -const { Bone } = require('../..'); +const { Bone } = require('../../src'); class Comment extends Bone { static initialize() { diff --git a/test/models/like.js b/test/models/like.js index a70119be..7166193d 100644 --- a/test/models/like.js +++ b/test/models/like.js @@ -1,6 +1,6 @@ 'use strict'; -const { Bone } =require('../..'); +const { Bone } =require('../../src'); const TARGET_TYPE = { post: 0, diff --git a/test/models/photo.ts b/test/models/photo.ts index 3f2a358a..d407a6e7 100644 --- a/test/models/photo.ts +++ b/test/models/photo.ts @@ -1,4 +1,4 @@ -import { BelongsTo, Bone, Column } from '../..'; +import { BelongsTo, Bone, Column } from '../../src'; import User from './user'; export default class Photo extends Bone { diff --git a/test/models/post.js b/test/models/post.js index 37e02286..77be0f9d 100644 --- a/test/models/post.js +++ b/test/models/post.js @@ -1,6 +1,6 @@ 'use strict'; -const { Bone } = require('../..'); +const { Bone } = require('../../src'); class Post extends Bone { static table = 'articles'; diff --git a/test/models/tag.js b/test/models/tag.js index 641c4302..6bf41436 100644 --- a/test/models/tag.js +++ b/test/models/tag.js @@ -1,6 +1,6 @@ 'use strict'; -const { Bone, DataTypes } = require('../..'); +const { Bone, DataTypes } = require('../../src'); const CHARSET = 'abcdefghigklmnopqrstuvwxyz0123456789'; @@ -29,7 +29,7 @@ class Tag extends Bone { type: DataTypes.STRING, unique: true, } - } + }; static beforeCreate(obj) { if (!obj.uuid) { diff --git a/test/models/tagMap.js b/test/models/tagMap.js index b27cf833..bc1f8a97 100644 --- a/test/models/tagMap.js +++ b/test/models/tagMap.js @@ -1,6 +1,6 @@ 'use strict'; -const { Bone } = require('../..'); +const { Bone } = require('../../src'); class TagMap extends Bone { static initialize() { diff --git a/test/models/user.js b/test/models/user.js index beb559f0..4bc8916b 100644 --- a/test/models/user.js +++ b/test/models/user.js @@ -1,6 +1,6 @@ 'use strict'; -const { Bone, DataTypes } = require('../..'); +const { Bone, DataTypes } = require('../../src'); const formatter = { formatName(value) { diff --git a/test/start.sh b/test/start.sh index b2a3610d..9f9a1414 100755 --- a/test/start.sh +++ b/test/start.sh @@ -37,22 +37,18 @@ function dts { case $1 in unit) args=("${@:2}") - npm run prepack unit ;; integration) args=("${@:2}") - npm run prepack integration ;; dts) args=("${@:2}") - npm run prepack dts ;; *.js) args=("${@:1}") - npm run prepack run $1 ;; *) diff --git a/test/types/basics.test.ts b/test/types/basics.test.ts index 0c24d5ce..bbe09324 100644 --- a/test/types/basics.test.ts +++ b/test/types/basics.test.ts @@ -1,6 +1,6 @@ import { strict as assert } from 'assert'; import sinon, { SinonFakeTimers } from 'sinon'; -import Realm, { Bone, Column, DataTypes, connect, Raw } from '../..'; +import Realm, { Bone, Column, DataTypes, connect, Raw } from '../../src'; describe('=> Basics (TypeScript)', function() { const { TEXT } = DataTypes; diff --git a/test/types/collection.test.ts b/test/types/collection.test.ts index 65a8b2e1..04ec2720 100644 --- a/test/types/collection.test.ts +++ b/test/types/collection.test.ts @@ -1,5 +1,5 @@ import { strict as assert } from 'assert'; -import { Bone, Collection, connect } from '../..'; +import { Bone, Collection, connect } from '../../src'; describe('=> Collection (TypeScript)', function() { class User extends Bone { diff --git a/test/types/custom_driver.test.ts b/test/types/custom_driver.test.ts index 27d5ec8c..fd426904 100644 --- a/test/types/custom_driver.test.ts +++ b/test/types/custom_driver.test.ts @@ -1,7 +1,7 @@ import { strict as assert } from 'assert'; const SqlString = require('sqlstring'); -import Realm, { SqliteDriver, SpellMeta, Literal, SpellBookFormatResult, Column, Raw } from '../..'; +import Realm, { SqliteDriver, SpellMeta, Literal, SpellBookFormatResult, Column, Raw } from '../../src'; const { formatConditions, collectLiteral } = require('../../src/expr_formatter'); const { findExpr } = require('../../src/expr'); diff --git a/test/types/data_types.test.ts b/test/types/data_types.test.ts index f3ced5a6..8aa0c063 100644 --- a/test/types/data_types.test.ts +++ b/test/types/data_types.test.ts @@ -1,5 +1,5 @@ import { strict as assert } from 'assert'; -import Realm, { DataTypes, LENGTH_VARIANTS } from '../..'; +import Realm, { DataTypes, LENGTH_VARIANTS } from '../../src'; describe('=> Data types (TypeScript)', function() { const { STRING, TEXT, BLOB, INTEGER, BIGINT, DATE, BOOLEAN, BINARY, VARBINARY, VIRTUAL, JSON, JSONB, DECIMAL } = DataTypes; @@ -11,7 +11,7 @@ describe('=> Data types (TypeScript)', function() { }); // should be mixed with dialect overrides assert.notEqual(realm.Bone.DataTypes, DataTypes); - }) + }); it('STRING', async function() { assert.equal(STRING(255).toSqlString(), 'VARCHAR(255)'); @@ -82,7 +82,7 @@ describe('=> Data types (TypeScript)', function() { it('BOOLEAN', () => { assert.equal(BOOLEAN.toSqlString(), 'BOOLEAN'); assert.equal((new BOOLEAN).toSqlString(), 'BOOLEAN'); - }) + }); it('BINARY', () => { // default 255 @@ -127,5 +127,5 @@ describe('=> Data types (TypeScript)', function() { assert.equal(DECIMAL.ZEROFILL.toSqlString(), 'DECIMAL ZEROFILL'); assert.equal(DECIMAL(10).ZEROFILL.toSqlString(), 'DECIMAL(10) ZEROFILL'); assert.equal(new DECIMAL(10).ZEROFILL.toSqlString(), 'DECIMAL(10) ZEROFILL'); - }) + }); }); diff --git a/test/types/decorators.test.ts b/test/types/decorators.test.ts index 71160c31..870e2dd6 100644 --- a/test/types/decorators.test.ts +++ b/test/types/decorators.test.ts @@ -1,5 +1,5 @@ import { strict as assert } from 'assert'; -import { AttributeMeta, Bone, DataTypes, Column, HasMany, BelongsTo, connect } from '../..'; +import { AttributeMeta, Bone, DataTypes, Column, HasMany, BelongsTo, connect } from '../../src'; const { TEXT, STRING, INTEGER } = DataTypes; diff --git a/test/types/querying.test.ts b/test/types/querying.test.ts index e7e4cc8f..2619f491 100644 --- a/test/types/querying.test.ts +++ b/test/types/querying.test.ts @@ -1,5 +1,5 @@ import { strict as assert } from 'assert'; -import { Bone, DataTypes, Column, HasMany, connect, Raw } from '../..'; +import { Bone, DataTypes, Column, HasMany, connect, Raw } from '../../src'; describe('=> Querying (TypeScript)', function() { const { BIGINT, INTEGER, STRING } = DataTypes; diff --git a/test/types/realm.test.ts b/test/types/realm.test.ts index 4565675c..9b61ef51 100644 --- a/test/types/realm.test.ts +++ b/test/types/realm.test.ts @@ -1,5 +1,5 @@ import { strict as assert } from 'assert'; -import Realm from '../..'; +import Realm from '../../src'; describe('=> Realm (TypeScript)', function () { let realm: Realm; diff --git a/test/types/sequelize.test.ts b/test/types/sequelize.test.ts index 6cb3f666..ef51964b 100644 --- a/test/types/sequelize.test.ts +++ b/test/types/sequelize.test.ts @@ -1,7 +1,7 @@ import { strict as assert } from 'assert'; const sinon = require('sinon'); -import { SequelizeBone, Column, DataTypes, connect, Hint, Raw, Bone } from '../..'; +import { SequelizeBone, Column, DataTypes, connect, Hint, Raw, Bone } from '../../src'; describe('=> sequelize (TypeScript)', function() { const { TEXT, STRING, VIRTUAL } = DataTypes; diff --git a/test/types/spell.test.ts b/test/types/spell.test.ts index cf1e987a..2c405df8 100644 --- a/test/types/spell.test.ts +++ b/test/types/spell.test.ts @@ -5,7 +5,7 @@ import { Bone, DataTypes, Column, HasOne, connect, INDEX_HINT_SCOPE_TYPE, INDEX_HINT_TYPE, INDEX_HINT_SCOPE, Hint, IndexHint, Raw, heresql, -} from '../..'; +} from '../../src'; describe('=> Spell (TypeScript)', function() { const { STRING, TEXT, TINYINT } = DataTypes; diff --git a/test/unit/adapters/sequelize.test.js b/test/unit/adapters/sequelize.test.js index 481d4f38..241ae9d5 100644 --- a/test/unit/adapters/sequelize.test.js +++ b/test/unit/adapters/sequelize.test.js @@ -3,7 +3,7 @@ const assert = require('assert').strict; const crypto = require('crypto'); const sinon = require('sinon'); -const { Bone, connect, sequelize, DataTypes, raw, Hint } = require('../../..'); +const { Bone, connect, sequelize, DataTypes, raw, Hint } = require('../../../src'); const userAttributes = { id: DataTypes.BIGINT, diff --git a/test/unit/bone.test.js b/test/unit/bone.test.js index a93ff92c..fe23a510 100644 --- a/test/unit/bone.test.js +++ b/test/unit/bone.test.js @@ -1,7 +1,7 @@ 'use strict'; const assert = require('assert').strict; -const { Bone, DataTypes, connect, default: Realm } = require('../..'); +const { Bone, DataTypes, connect, default: Realm } = require('../../src'); const expect = require('expect.js'); const { @@ -95,7 +95,7 @@ describe('=> Bone', function() { class User extends Bone { static attributes = { iid: { type: BIGINT, primaryKey: true }, - } + }; }; await User.load([ { columnName: 'iid', columnType: 'bigint', dataType: 'bigint', primaryKey: true }, @@ -108,7 +108,7 @@ describe('=> Bone', function() { class User extends Bone { static attributes = { name: STRING, - } + }; } User.load([ { columnName: 'id', columnType: 'bigint', dataType: 'bigint', primaryKey: true }, @@ -125,7 +125,7 @@ describe('=> Bone', function() { createdAt: DATE, updatedAt: DATE, deletedAt: DATE, - } + }; } User.load([ { columnName: 'id', columnType: 'bigint', dataType: 'bigint', primaryKey: true }, @@ -147,7 +147,7 @@ describe('=> Bone', function() { created_at: DATE, updated_at: DATE, deleted_at: DATE, - } + }; } User.load([ { columnName: 'id', columnType: 'bigint', dataType: 'bigint', primaryKey: true }, @@ -167,7 +167,7 @@ describe('=> Bone', function() { createdAt: DATE, updatedAt: DATE, deletedAt: DATE, - } + }; } User.load([ { columnName: 'id', columnType: 'bigint', dataType: 'bigint', primaryKey: true }, @@ -182,7 +182,7 @@ describe('=> Bone', function() { class User extends Bone { static attributes = { ssn: { type: STRING, primaryKey: true }, - } + }; } User.load([ { columnName: 'ssn', columnType: 'varchar', dataType: 'varchar', primaryKey: true }, @@ -196,7 +196,7 @@ describe('=> Bone', function() { static attributes = { createdAt: new DATE, updatedAt: new DATE(0), - } + }; } User.load([ { columnName: 'created_at', columnType: 'timestamp(3)', dataType: 'timestamp', datetimePrecision: 3 }, @@ -211,7 +211,7 @@ describe('=> Bone', function() { class User extends Bone { static attributes = { createdAt: DATE, - } + }; } User.load([ { columnName: 'id', columnType: 'bigint', dataType: 'bigint', primaryKey: true }, @@ -227,7 +227,7 @@ describe('=> Bone', function() { static attributes = { createdAt: DATE, realName: VIRTUAL, - } + }; } assert.deepEqual(Object.keys(User.attributes).sort(), [ 'createdAt', 'realName' ]); assert.deepEqual(Object.keys(User.columnAttributes).sort(), [ 'createdAt' ]); @@ -265,7 +265,7 @@ describe('=> Bone', function() { class User extends Bone { static attributes = { foo: { type: STRING }, - } + }; } User.load([ { columnName: 'foo', columnType: 'varchar', dataType: 'varchar' }, @@ -282,7 +282,7 @@ describe('=> Bone', function() { class User extends Bone { static attributes = { foo: { type: STRING }, - } + }; get bar() { return this.attribute('bar'); } @@ -330,7 +330,7 @@ describe('=> Bone', function() { static attributes = { authorId: BIGINT, updatedAt: { type: DATE, allowNull: false }, - } + }; } await Note.sync({ force: true }); const note = await Note.create({ authorId: 4 }); @@ -344,7 +344,7 @@ describe('=> Bone', function() { authorId: BIGINT, updatedAt: { type: DATE, allowNull: false }, halo: VIRTUAL, - } + }; } await Note.sync({ force: true }); const note = await Note.create({ halo: 'yes' }); @@ -358,7 +358,7 @@ describe('=> Bone', function() { authorId: BIGINT, updatedAt: { type: DATE, allowNull: false }, halo: VIRTUAL, - } + }; get halo() { return this.attribute('halo'); } @@ -388,7 +388,7 @@ describe('=> Bone', function() { static attributes = { isPrivate: TINYINT(1), wordCount: MEDIUMINT, - } + }; } await Note.sync({ force: true }); const result = await Note.describe(); @@ -403,7 +403,7 @@ describe('=> Bone', function() { isPrivate: TINYINT(1), wordCount: MEDIUMINT, halo: VIRTUAL, - } + }; } await Note.sync({ force: true }); const result = await Note.describe(); diff --git a/test/unit/collection.test.js b/test/unit/collection.test.js index b5f77ba5..124125f1 100644 --- a/test/unit/collection.test.js +++ b/test/unit/collection.test.js @@ -1,11 +1,11 @@ 'use strict'; const assert = require('assert').strict; -const { Bone, Collection, connect, raw } = require('../..'); +const { Bone, Collection, connect, raw } = require('../../src'); describe('=> Collection', function() { class Post extends Bone { - static table = 'articles' + static table = 'articles'; } class User extends Bone { diff --git a/test/unit/connect.test.js b/test/unit/connect.test.js index 65113d1a..5312ca6c 100644 --- a/test/unit/connect.test.js +++ b/test/unit/connect.test.js @@ -2,7 +2,7 @@ const assert = require('assert').strict; const path = require('path'); -const { connect, Bone, DataTypes } = require('../..'); +const { connect, Bone, DataTypes } = require('../../src'); describe('connect', function() { beforeEach(() => { @@ -63,7 +63,7 @@ describe('connect', function() { createdAt: { type: DATE }, updatedAt: { type: DATE }, deletedAt: { type: DATE }, - } + }; } await connect({ port: process.env.MYSQL_PORT, diff --git a/test/unit/drivers/abstract/index.test.js b/test/unit/drivers/abstract/index.test.js index 6e2de127..5e5a9fa3 100644 --- a/test/unit/drivers/abstract/index.test.js +++ b/test/unit/drivers/abstract/index.test.js @@ -1,7 +1,7 @@ 'use strict'; const assert = require('assert').strict; -const { Logger, AbstractDriver } = require('../../../..'); +const { Logger, AbstractDriver } = require('../../../../src'); describe('=> AbstractDriver#logger', function() { it('should create logger by default', async function() { diff --git a/test/unit/drivers/abstract/spellbook.test.js b/test/unit/drivers/abstract/spellbook.test.js index 1e4e857d..705b1858 100644 --- a/test/unit/drivers/abstract/spellbook.test.js +++ b/test/unit/drivers/abstract/spellbook.test.js @@ -1,7 +1,7 @@ 'use strict'; const assert = require('assert').strict; -const { connect, heresql, Bone } = require('../../../..'); +const { connect, heresql, Bone } = require('../../../../src'); describe('=> Spellbook', function() { class User extends Bone {} diff --git a/test/unit/expr_formatter.test.js b/test/unit/expr_formatter.test.js index a9e5de74..352d237a 100644 --- a/test/unit/expr_formatter.test.js +++ b/test/unit/expr_formatter.test.js @@ -2,12 +2,12 @@ const assert = require('assert').strict; const dayjs = require('dayjs'); -const { connect, Bone } = require('../..'); +const { connect, Bone } = require('../../src'); describe('=> formatExpr', function() { class Post extends Bone { - static table = 'articles' + static table = 'articles'; static initialize() { this.attribute('settings', { type: JSON }); } diff --git a/test/unit/hint.test.js b/test/unit/hint.test.js index dd24aa65..5006332c 100644 --- a/test/unit/hint.test.js +++ b/test/unit/hint.test.js @@ -5,7 +5,7 @@ const assert = require('assert').strict; const { connect, Bone, Hint, IndexHint, INDEX_HINT_TYPE, INDEX_HINT_SCOPE, -} = require('../..'); +} = require('../../src'); describe('Hint', () => { it('text= should strip comment syntax', () => { diff --git a/test/unit/hooks.test.js b/test/unit/hooks.test.js index a90861a3..cef2c74b 100644 --- a/test/unit/hooks.test.js +++ b/test/unit/hooks.test.js @@ -1,8 +1,8 @@ 'use strict'; const assert = require('assert').strict; -const { connect } = require('../..'); -const { Bone, DataTypes, sequelize } = require('../..'); +const { connect } = require('../../src'); +const { Bone, DataTypes, sequelize } = require('../../src'); const attributes = { id: DataTypes.BIGINT, diff --git a/test/unit/query_object.test.js b/test/unit/query_object.test.js index 192113ad..929eeb7f 100644 --- a/test/unit/query_object.test.js +++ b/test/unit/query_object.test.js @@ -5,11 +5,11 @@ const SqlString = require('sqlstring'); const { parseObject } = require('../../src/query_object'); const { formatConditions, collectLiteral } = require('../../src/expr_formatter'); -const { Bone, connect } = require('../..'); +const { Bone, connect } = require('../../src'); describe('=> parseObject', function() { class Post extends Bone { - static table = 'articles' + static table = 'articles'; } let spell; diff --git a/test/unit/realm.test.js b/test/unit/realm.test.js index 5e06c4b1..4a672be0 100644 --- a/test/unit/realm.test.js +++ b/test/unit/realm.test.js @@ -2,7 +2,7 @@ const assert = require('assert').strict; const path = require('path'); -const Realm = require('../..'); +const Realm = require('../../src'); const { connect, Bone, DataTypes, Logger, Spell, SqliteDriver, SequelizeBone } = Realm; const attributes = { diff --git a/test/unit/spell.test.js b/test/unit/spell.test.js index d502fa60..060be49d 100644 --- a/test/unit/spell.test.js +++ b/test/unit/spell.test.js @@ -3,10 +3,10 @@ const assert = require('assert').strict; const sinon = require('sinon'); -const { connect, raw, Bone, heresql } = require('../..'); +const { connect, raw, Bone, heresql } = require('../../src'); class Post extends Bone { - static table = 'articles' + static table = 'articles'; static initialize() { this.hasOne('attachment', { foreignKey: 'articleId' }); this.hasMany('comments', { diff --git a/test/unit/timestamp.test.js b/test/unit/timestamp.test.js index be3df3ad..783a5b9d 100644 --- a/test/unit/timestamp.test.js +++ b/test/unit/timestamp.test.js @@ -1,7 +1,7 @@ 'use strict'; const assert = require('assert').strict; -const { connect, Bone, DataTypes } = require('../..'); +const { connect, Bone, DataTypes } = require('../../src'); describe('connect', function() { beforeEach(() => { @@ -36,7 +36,7 @@ describe('connect', function() { createdAt: { type: DATE }, updatedAt: { type: DATE }, deletedAt: { type: DATE }, - } + }; } await connect({ port: process.env.MYSQL_PORT, @@ -62,7 +62,7 @@ describe('connect', function() { created_at: { type: DATE }, updated_at: { type: DATE }, deleted_at: { type: DATE }, - } + }; } await connect({ port: process.env.MYSQL_PORT, @@ -89,7 +89,7 @@ describe('connect', function() { created_at: { type: DATE }, updatedAt: { type: DATE }, deleted_at: { type: DATE }, - } + }; } await connect({ port: process.env.MYSQL_PORT, diff --git a/test/unit/utils/index.test.js b/test/unit/utils/index.test.js index 5adc18d4..7d88b6e5 100644 --- a/test/unit/utils/index.test.js +++ b/test/unit/utils/index.test.js @@ -1,7 +1,7 @@ 'use strict'; const assert = require('assert').strict; -const { Bone, sequelize, isBone } = require('../../..'); +const { Bone, sequelize, isBone } = require('../../../src'); const { compose, getPropertyNames, logger } = require('../../../src/utils'); describe('=> compose', function() { diff --git a/test/unit/utils/string.test.ts b/test/unit/utils/string.test.ts index 1760a3bc..ab55f6b0 100644 --- a/test/unit/utils/string.test.ts +++ b/test/unit/utils/string.test.ts @@ -1,6 +1,6 @@ import { strict as assert } from 'assert'; -import { heresql } from '../../..'; +import { heresql } from '../../../src'; describe('=> heresql', function() { it('should accept function comment', function() { diff --git a/test/unit/validator.test.js b/test/unit/validator.test.js index 8d4f5a60..0760d3a7 100644 --- a/test/unit/validator.test.js +++ b/test/unit/validator.test.js @@ -2,7 +2,7 @@ const assert = require('assert').strict; -const { connect, Bone, DataTypes } = require('../..'); +const { connect, Bone, DataTypes } = require('../../src'); describe('validator', () => { const attributes = {