Skip to content

Commit

Permalink
Fixing the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraenhansen committed Jan 7, 2021
1 parent 98697af commit b02e739
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 68 deletions.
99 changes: 51 additions & 48 deletions integration-tests/tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion integration-tests/tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"realm": "*"
},
"devDependencies": {
"@types/bson": "^4.0.2",
"@types/chai": "^4.1.7",
"@types/mocha": "^5.2.6",
"fs-extra": "^7.0.1",
Expand All @@ -26,6 +25,7 @@
"typescript": "^3.8.2"
},
"dependencies": {
"bson": "^4.2.0",
"chai": "^4.2.0"
},
"files": [
Expand Down
9 changes: 4 additions & 5 deletions integration-tests/tests/src/objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
Person as PersonWithId,
PersonSchema as PersonSchemaWithId,
} from "./schemas/person-and-dog-with-object-ids";
import { ObjectId } from "bson";

describe("Realm objects", () => {
describe("Interface & object literal", () => {
Expand Down Expand Up @@ -45,7 +44,7 @@ describe("Realm objects", () => {

it("can be fetched with objectForPrimaryKey", () => {
const realm = new Realm({ schema: [PersonSchemaWithId] });
const _id = new ObjectId();
const _id = new Realm.BSON.ObjectId();

realm.write(() => {
realm.create<PersonWithId>(PersonSchemaWithId.name, {
Expand All @@ -69,7 +68,7 @@ describe("Realm objects", () => {
it("can be updated", () => {
const realm = new Realm({ schema: [PersonSchemaWithId] });
let john: IPersonWithId;
const _id = new ObjectId();
const _id = new Realm.BSON.ObjectId();

realm.write(() => {
john = realm.create<IPersonWithId>(PersonSchemaWithId.name, {
Expand Down Expand Up @@ -164,7 +163,7 @@ describe("Realm objects", () => {

it("can be fetched with objectForPrimaryKey", () => {
const realm = new Realm({ schema: [PersonWithId] });
const _id = new ObjectId();
const _id = new Realm.BSON.ObjectId();

realm.write(() => {
realm.create(PersonWithId, {
Expand All @@ -185,7 +184,7 @@ describe("Realm objects", () => {
it("can be updated", () => {
const realm = new Realm({ schema: [PersonWithId] });
let john: PersonWithId;
const _id = new ObjectId();
const _id = new Realm.BSON.ObjectId();

realm.write(() => {
john = realm.create(PersonWithId, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/* tslint:disable max-classes-per-file */

import * as Realm from "realm";
import Realm from "realm";
import { ObjectId } from "bson";

export interface IPerson {
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/tests/src/schemas/person-and-dogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/* tslint:disable max-classes-per-file */

import * as Realm from "realm";
import Realm from "realm";

export interface IPerson {
name: string;
Expand Down
3 changes: 1 addition & 2 deletions integration-tests/tests/src/serialization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
////////////////////////////////////////////////////////////////////////////

import { expect } from "chai";
import { ObjectId } from "bson";
import {
IPlaylist as IPlaylistNoId,
ISong as ISongNoId,
Expand Down Expand Up @@ -439,7 +438,7 @@ const cacheIdTestSetups: ICacheIdTestSetup[] = [
{
type: "objectId",
schemaName: "ObjectIdTest",
testId: new ObjectId("5f99418846da9c45005f50bf"),
testId: new Realm.BSON.ObjectId("5f99418846da9c45005f50bf"),
expectedResult: "ObjectIdTest#5f99418846da9c45005f50bf",
},
];
Expand Down
8 changes: 3 additions & 5 deletions integration-tests/tests/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@
"target": "es2018",
"module": "commonjs",
"moduleResolution": "node",
"esModuleInterop": true,
"resolveJsonModule": true,
"outDir": "dist",
"types": [
"node",
"realm",
"bson",
"buffer",
"mocha",
"chai"
],
"typeRoots": [
"types",
"node_modules/@types"
],
"noImplicitAny": true
},
"include": [
Expand Down
5 changes: 0 additions & 5 deletions integration-tests/tests/types/node/index.d.ts

This file was deleted.

1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"compilerOptions": {
"strict": true,
"esModuleInterop": true,
"moduleResolution": "node",
"forceConsistentCasingInFileNames": true,
"target": "ES2018",
},
Expand Down

0 comments on commit b02e739

Please sign in to comment.