Skip to content

Commit

Permalink
fix: fix unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyDaddy committed Feb 1, 2024
1 parent a527d45 commit efe2cf9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/types/spell.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ describe('=> Spell (TypeScript)', function() {
it('arbitrary join', function() {
assert.equal(
Post.join(Comment, 'comments.articleId = posts.id').toString(),
'SELECT `posts`.*, `comments`.* FROM `articles` AS `posts` LEFT JOIN `comments` AS `comments` ON `comments`.`article_id` = `posts`.`id` WHERE `posts`.`gmt_deleted` IS NULL'
'SELECT `posts`.*, `comments`.* FROM `articles` AS `posts` LEFT JOIN `comments` AS `comments` ON `posts`.`id` = `comments`.`article_id` WHERE `posts`.`gmt_deleted` IS NULL'
);
});
});
Expand Down
4 changes: 2 additions & 2 deletions test/unit/spell.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ describe('=> Spell', function() {
it('arbitrary join', function() {
assert.equal(
Post.join(Comment, 'comments.articleId = posts.id').toString(),
'SELECT `posts`.*, `comments`.* FROM `articles` AS `posts` LEFT JOIN `comments` AS `comments` ON `comments`.`article_id` = `posts`.`id` WHERE `posts`.`gmt_deleted` IS NULL'
'SELECT `posts`.*, `comments`.* FROM `articles` AS `posts` LEFT JOIN `comments` AS `comments` ON `posts`.`id` = `comments`.`article_id` AND `comments`.`gmt_deleted` IS NULL WHERE `posts`.`gmt_deleted` IS NULL'
);

assert.equal(Post.include('comments').limit(1).toSqlString(), heresql(function () {
Expand Down Expand Up @@ -615,7 +615,7 @@ describe('=> Spell', function() {

assert.equal(
Post.join(Comment, 'comments.articleId = posts.id').limit(1).toString(),
'SELECT `posts`.*, `comments`.* FROM `articles` AS `posts` LEFT JOIN `comments` AS `comments` ON `comments`.`article_id` = `posts`.`id` WHERE `posts`.`gmt_deleted` IS NULL LIMIT 1'
'SELECT `posts`.*, `comments`.* FROM `articles` AS `posts` LEFT JOIN `comments` AS `comments` ON `posts`.`id` = `comments`.`article_id` AND `comments`.`gmt_deleted` IS NULL WHERE `posts`.`gmt_deleted` IS NULL LIMIT 1'
);

});
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"target": "ES2020",
},
"include": [
"src/**/*"
"src/**/*",
"test/**/*.ts"
],
"exclude": [
"dist",
Expand Down

0 comments on commit efe2cf9

Please sign in to comment.