mirror of
https://github.com/remotely-save/remotely-save.git
synced 2024-06-07 21:10:45 +00:00
22 lines
534 B
TypeScript
22 lines
534 B
TypeScript
const webcrypto = require("crypto").webcrypto;
|
|
|
|
import { expect } from "chai";
|
|
import { encryptStringToBase32 } from "../src/encrypt";
|
|
|
|
describe("Encryption tests", () => {
|
|
beforeEach(function () {
|
|
const window = {
|
|
crypto: webcrypto,
|
|
};
|
|
|
|
global.window = window as any;
|
|
});
|
|
|
|
it("should encrypt string", async () => {
|
|
const k = "dkjdhkfhdkjgsdklxxd";
|
|
const password = "hey";
|
|
//console.log(window.crypto.getRandomValues)
|
|
expect(await encryptStringToBase32(k, password)).to.not.equal(k);
|
|
});
|
|
});
|