Skip to content

Commit fb39884

Browse files
authored
Development (mongodb#25)
* restore tests * restore test suite changes and update function names * add test for context functions * Commit performed using Copy Push Files action * fixing merge issue --------- Co-authored-by: MongoCaleb <[email protected]>
1 parent e565894 commit fb39884

File tree

5 files changed

+32
-1
lines changed

5 files changed

+32
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"updateDescription.updatedFields": {
3+
"status": "blocked"
4+
}
5+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"operationType": {
3+
"$numberInt": "1"
4+
},
5+
"updateDescription.updatedFields.FieldA": {
6+
"$numberInt": "1"
7+
}
8+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Credentials } from "realm";
2+
import { getDeviceSDKApp, sleep } from "../utils";
3+
4+
describe("Test Other Functions", () => {
5+
test("Test Context Functions", async () => {
6+
7+
const app = getDeviceSDKApp();
8+
const anonCredentials = Credentials.anonymous();
9+
const user = await app.logIn(anonCredentials);
10+
expect(user).toBeTruthy;
11+
12+
const result = (await user.functions.context_callFunction(
13+
1,7
14+
)) as number;
15+
16+
expect(result).toBe(8);
17+
})
18+
})

tests/integration/jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const config: Config = {
1919
preset: "ts-jest/presets/js-with-ts",
2020
setupFilesAfterEnv: ["<rootDir>/jestSetup.ts"],
2121
modulePathIgnorePatterns: ["<rootDir>/__tests__/testFiles"],
22-
testMatch: ["<rootDir>/__tests__/**/*.test.ts"],
22+
testMatch: ["<rootDir>/__tests__/*.ts"],
2323
transform: {
2424
"^.+\\.ts$": "ts-jest",
2525
},

0 commit comments

Comments
 (0)