Skip to content

Commit

Permalink
fix: mocha tests
Browse files Browse the repository at this point in the history
  • Loading branch information
limpbrains committed Jul 24, 2024
1 parent ccbb8db commit 9cff553
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
16 changes: 9 additions & 7 deletions example/Tests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,16 @@ class Tests extends Component {
// global.fs = require("react-native-fs");
// global.path = require("path-browserify");
// global.environment = {
// Default to the host machine when running on Android
// realmBaseUrl: Platform.OS === "android" ? "http://10.0.2.2:9090" : undefined,
// ...context,
// reactNative: Platform.OS,
// android: Platform.OS === "android",
// ios: Platform.OS === "ios",
// Default to the host machine when running on Android
// realmBaseUrl: Platform.OS === "android" ? "http://10.0.2.2:9090" : undefined,
// ...context,
// reactNative: Platform.OS,
// android: Platform.OS === "android",
// ios: Platform.OS === "ios",
// };
global.environment = JSON.parse(Buffer.from(context.c as string, 'hex').toString('utf-8'));
global.environment = JSON.parse(
Buffer.from(context.c as string, 'hex').toString('utf-8'),
);
// Make the tests reinitializable, to allow test running on changes to the "realm" package
// Probing the existance of `getModules` as this only exists in debug mode
// if ("getModules" in require) {
Expand Down
6 changes: 3 additions & 3 deletions example/tests/utils/clightning-rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export default class ClightningRPC {
this.port = opts.port;

this.headers = {
'Accept': 'application/json',
Accept: 'application/json',
'Content-type': 'application/json',
'Rune': this.rune,
Rune: this.rune,
};
}

Expand Down Expand Up @@ -57,7 +57,7 @@ export default class ClightningRPC {
this.destroyed = true;
}

async _post({ path, body }: {path: string; body?: object}): Promise<any> {
async _post({ path, body }: { path: string; body?: object }): Promise<any> {
const jsonBody = JSON.stringify(body || {});
return await this._request({ method: 'POST', path, body: jsonBody });
}
Expand Down

0 comments on commit 9cff553

Please sign in to comment.