Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using default import of Realm in tests
Browse files Browse the repository at this point in the history
kraenhansen committed May 26, 2023
1 parent 945386a commit 110c3a2
Showing 25 changed files with 29 additions and 29 deletions.
10 changes: 5 additions & 5 deletions integration-tests/tests/package.json
Original file line number Diff line number Diff line change
@@ -20,35 +20,35 @@
"build": {
"command": "tsc",
"dependencies": [
"../../packages/realm:bundle",
"../../packages/realm:build:ts",
"build-dependencies"
]
},
"start": {
"command": "mocha --watch",
"dependencies": [
"../../packages/realm:bundle",
"../../packages/realm:build:ts",
"build-dependencies"
]
},
"test": {
"command": "mocha --exit",
"dependencies": [
"../../packages/realm:bundle",
"../../packages/realm:build:ts",
"build-dependencies"
]
},
"coverage": {
"command": "nyc mocha --exit",
"dependencies": [
"../../packages/realm:bundle:coverage",
"../../packages/realm:build:ts:coverage",
"build-dependencies"
]
},
"ci:coverage": {
"command": "nyc --reporter=lcov -- mocha --exit",
"dependencies": [
"../../packages/realm:bundle:coverage",
"../../packages/realm:build:ts:coverage",
"build-dependencies"
]
},
2 changes: 1 addition & 1 deletion integration-tests/tests/src/hooks/import-app-before.ts
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
//
////////////////////////////////////////////////////////////////////////////

import { Realm, AppConfiguration } from "realm";
import Realm, { AppConfiguration } from "realm";

import { importApp } from "../utils/import-app";
import { AppConfig } from "@realm/app-importer";
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
//
////////////////////////////////////////////////////////////////////////////

import { Realm } from "realm";
import Realm from "realm";

import { describePerformance } from "../utils/benchmark";

2 changes: 1 addition & 1 deletion integration-tests/tests/src/schemas/contact.ts
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@

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

import { Realm } from "realm";
import Realm from "realm";

export interface IContact {
name: string;
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@

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

import { Realm } from "realm";
import Realm from "realm";

export interface IPerson {
_id: Realm.BSON.ObjectId;
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
@@ -18,7 +18,7 @@

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

import { Realm } from "realm";
import Realm from "realm";

export interface IPerson {
name: string;
2 changes: 1 addition & 1 deletion integration-tests/tests/src/setup-globals.ts
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ describe("Test Harness", function (this: Mocha.Suite) {
Context.prototype.longTimeout = longTimeout;
});

import { Realm } from "realm";
import Realm from "realm";

// Disable the logger to avoid console flooding
const { defaultLogLevel = "off" } = environment;
2 changes: 1 addition & 1 deletion integration-tests/tests/src/tests/class-models.ts
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
////////////////////////////////////////////////////////////////////////////

import { expect } from "chai";
import { Realm } from "realm";
import Realm from "realm";

import { openRealmBeforeEach } from "../hooks";

Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
////////////////////////////////////////////////////////////////////////////

import { expect } from "chai";
import { Realm } from "realm";
import Realm from "realm";
import { openRealmBeforeEach } from "../hooks";

import { PersonSchema, DogSchema } from "../schemas/person-and-dogs";
2 changes: 1 addition & 1 deletion integration-tests/tests/src/tests/list.ts
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
//
////////////////////////////////////////////////////////////////////////////

import { Realm, BSON } from "realm";
import Realm, { BSON } from "realm";
import { expectArraysEqual, expectSimilar } from "../utils/comparisons";
import { expect } from "chai";
import { CanonicalObjectSchema } from "realm";
2 changes: 1 addition & 1 deletion integration-tests/tests/src/tests/listeners.ts
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
////////////////////////////////////////////////////////////////////////////

import { expect } from "chai";
import { Realm } from "realm";
import Realm from "realm";
import { openRealmBeforeEach } from "../hooks";

import { PersonSchema, DogSchema } from "../schemas/person-and-dogs";
2 changes: 1 addition & 1 deletion integration-tests/tests/src/tests/objects.ts
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
//
////////////////////////////////////////////////////////////////////////////
import { expect } from "chai";
import { Realm } from "realm";
import Realm from "realm";

import { IPerson, Person, PersonSchema } from "../schemas/person-and-dogs";
import {
2 changes: 1 addition & 1 deletion integration-tests/tests/src/tests/realm-constructor.ts
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
////////////////////////////////////////////////////////////////////////////

import { expect } from "chai";
import { Realm } from "realm";
import Realm from "realm";

import { IPerson, PersonSchema, DogSchema } from "../schemas/person-and-dogs";

2 changes: 1 addition & 1 deletion integration-tests/tests/src/tests/schema.ts
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@

import { expect } from "chai";
import { openRealmBefore } from "../hooks";
import { Realm } from "realm";
import Realm from "realm";

interface Test {
primary: number;
2 changes: 1 addition & 1 deletion integration-tests/tests/src/tests/serialization.ts
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
////////////////////////////////////////////////////////////////////////////

import { expect } from "chai";
import { Realm } from "realm";
import Realm from "realm";

type DefaultObject = Record<string, unknown>;

2 changes: 1 addition & 1 deletion integration-tests/tests/src/tests/set.ts
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
////////////////////////////////////////////////////////////////////////////

import { expect } from "chai";
import { Realm } from "realm";
import Realm from "realm";

import { openRealmBefore } from "../hooks";

2 changes: 1 addition & 1 deletion integration-tests/tests/src/tests/shared-realms.ts
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
////////////////////////////////////////////////////////////////////////////

import { expect } from "chai";
import { Realm, List } from "realm";
import Realm, { List } from "realm";

import { openRealmBefore, openRealmBeforeEach } from "../hooks";
import { createLocalConfig } from "../utils/open-realm";
2 changes: 1 addition & 1 deletion integration-tests/tests/src/tests/sync/mixed.ts
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
//
////////////////////////////////////////////////////////////////////////////
import { expect } from "chai";
import { Realm } from "realm";
import Realm from "realm";

import { importAppBefore, authenticateUserBefore, openRealmBefore } from "../../hooks";

2 changes: 1 addition & 1 deletion integration-tests/tests/src/tests/sync/open.ts
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
////////////////////////////////////////////////////////////////////////////

import { expect } from "chai";
import { Realm } from "realm";
import Realm from "realm";

import { authenticateUserBefore, importAppBefore } from "../../hooks";
import { buildAppConfig } from "../../utils/build-app-config";
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
//
////////////////////////////////////////////////////////////////////////////

import { Realm, BSON } from "realm";
import Realm, { BSON } from "realm";
import { expect } from "chai";
import { importAppBefore } from "../../hooks";
import { getRegisteredEmailPassCredentials } from "../../utils/credentials";
2 changes: 1 addition & 1 deletion integration-tests/tests/src/tests/sync/sync-as-local.ts
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
////////////////////////////////////////////////////////////////////////////

import { expect } from "chai";
import { Realm } from "realm";
import Realm from "realm";

import { PersonSchema, IPerson } from "../../schemas/person-and-dog-with-object-ids";
import { authenticateUserBefore, importAppBefore, openRealmBefore } from "../../hooks";
2 changes: 1 addition & 1 deletion integration-tests/tests/src/tests/sync/sync-session.ts
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
////////////////////////////////////////////////////////////////////////////

import { expect } from "chai";
import { Realm, ConnectionState, ObjectSchema, BSON, User, SyncConfiguration } from "realm";
import Realm, { ConnectionState, ObjectSchema, BSON, User, SyncConfiguration } from "realm";
import { importAppBefore } from "../../hooks";
import { DogSchema } from "../../schemas/person-and-dog-with-object-ids";
import { getRegisteredEmailPassCredentials } from "../../utils/credentials";
2 changes: 1 addition & 1 deletion integration-tests/tests/src/tests/sync/user.ts
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ import {
randomVerifiableEmail,
} from "../../utils/generators";
import { KJUR } from "jsrsasign";
import { Realm, UserState } from "realm";
import Realm, { UserState } from "realm";

import { buildAppConfig } from "../../utils/build-app-config";

2 changes: 1 addition & 1 deletion integration-tests/tests/src/tests/types.ts
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
////////////////////////////////////////////////////////////////////////////

import { expect } from "chai";
import { Realm } from "realm";
import Realm from "realm";

describe("Realm.Types namespace", () => {
// We specify explicit types on the instance so TS will error if the type def is wrong
2 changes: 1 addition & 1 deletion integration-tests/tests/src/utils/open-realm.ts
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
//
////////////////////////////////////////////////////////////////////////////

import { Realm, Configuration, SyncConfiguration, User, BSON } from "realm";
import Realm, { Configuration, SyncConfiguration, User, BSON } from "realm";

// Either the sync property is left out (local Realm)
export type LocalConfiguration = Omit<Configuration, "sync"> & { sync?: never };

0 comments on commit 110c3a2

Please sign in to comment.