(t *testing.T)
| 976 | } |
| 977 | |
| 978 | func TestSecurityEncryptAndDecryptBinds(t *testing.T) { |
| 979 | vm := goja.New() |
| 980 | BindCore(vm) |
| 981 | BindSecurity(vm) |
| 982 | |
| 983 | _, err := vm.RunString(` |
| 984 | const key = "abcdabcdabcdabcdabcdabcdabcdabcd" |
| 985 | |
| 986 | const encrypted = $security.encrypt("123", key) |
| 987 | |
| 988 | const decrypted = $security.decrypt(encrypted, key) |
| 989 | |
| 990 | if (decrypted != "123") { |
| 991 | throw new Error("Expected decrypted '123', got " + decrypted) |
| 992 | } |
| 993 | `) |
| 994 | if err != nil { |
| 995 | t.Fatal(err) |
| 996 | } |
| 997 | } |
| 998 | |
| 999 | func TestBindFilesystem(t *testing.T) { |
| 1000 | app, _ := tests.NewTestApp() |
nothing calls this directly
no test coverage detected
searching dependent graphs…