mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
test: when calling AVG on an integer column, MS SQL Server returns an int. (#9784)
In this case, 50 instead of 50.5. Apparently the ANSI standard for SQL is silent on this issue, so either behavior should be considered acceptable.
This commit is contained in:
parent
f530811b0d
commit
0619aca174
@ -46,7 +46,9 @@ describe("repository > aggregate methods", () => {
|
||||
describe("average", () => {
|
||||
it("should return the aggregate average", async () => {
|
||||
const average = await repository.average("counter")
|
||||
expect(average).to.equal(50.5)
|
||||
// Some RDBMSs (e.g. SQL Server) will return an int when averaging an int column, so either
|
||||
// answer is acceptable.
|
||||
expect([50, 50.5]).to.include(average)
|
||||
})
|
||||
|
||||
it("should return null when 0 rows match the query", async () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user