diff --git a/bindings/matrix-sdk-crypto-nodejs/src/lib.rs b/bindings/matrix-sdk-crypto-nodejs/src/lib.rs index 98a90bcea..540204be7 100644 --- a/bindings/matrix-sdk-crypto-nodejs/src/lib.rs +++ b/bindings/matrix-sdk-crypto-nodejs/src/lib.rs @@ -34,23 +34,23 @@ pub mod types; pub mod vodozemac; /// Object containing the versions of the Rust libraries we are using. -#[napi(object)] +#[napi] pub struct Versions { /// The version of the vodozemac crate. #[napi(getter)] - pub vodozemac: &'static str, + pub vodozemac: String, /// The version of the matrix-sdk-crypto crate. #[napi(getter)] - pub matrix_sdk_crypto: &'static str, + pub matrix_sdk_crypto: String, } /// Get the versions of the Rust libraries we are using. #[napi(js_name = "getVersions")] pub fn get_versions() -> Versions { Versions { - vodozemac: matrix_sdk_crypto::vodozemac::VERSION, - matrix_sdk_crypto: matrix_sdk_crypto::VERSION, + vodozemac: matrix_sdk_crypto::vodozemac::VERSION.to_owned(), + matrix_sdk_crypto: matrix_sdk_crypto::VERSION.to_owned(), } } diff --git a/bindings/matrix-sdk-crypto-nodejs/tests/machine.test.js b/bindings/matrix-sdk-crypto-nodejs/tests/machine.test.js index 50a4a83b9..86b93533b 100644 --- a/bindings/matrix-sdk-crypto-nodejs/tests/machine.test.js +++ b/bindings/matrix-sdk-crypto-nodejs/tests/machine.test.js @@ -36,8 +36,9 @@ describe("Versions", () => { expect(versions).toBeInstanceOf(Versions); expect(versions.vodozemac).toBeDefined(); - expect(versions.matrix_sdk_crypto).toBeDefined(); + expect(versions.matrixSdkCrypto).toBeDefined(); }); + }); describe(OlmMachine.name, () => {