Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xxdk-wasm
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
xxdk-wasm
Commits
a2c1fb23
Commit
a2c1fb23
authored
2 years ago
by
Jake Taylor
Browse files
Options
Downloads
Plain Diff
Merge branch 'release' into project/DM
parents
1a89f853
8f3ed6e1
No related branches found
No related tags found
3 merge requests
!60
Revert "Fail a test to be sure it works"
,
!36
project/DM
,
!32
Admin Commands
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+1
-1
1 addition, 1 deletion
.gitlab-ci.yml
utils/convert.go
+4
-0
4 additions, 0 deletions
utils/convert.go
utils/convert_test.go
+16
-0
16 additions, 0 deletions
utils/convert_test.go
with
21 additions
and
1 deletion
.gitlab-ci.yml
+
1
−
1
View file @
a2c1fb23
...
...
@@ -65,7 +65,7 @@ version_check:
script
:
-
GITTAG=$(git describe --tags)
-
CODEVERS=$(cat storage/version.go | grep "const SEMVER =" | cut -d ' ' -f4 | tr -d '"')
-
if [[ $GITTAG != $CODEVERS ]]; then echo "VERSION NUMBER BAD $GITTAG != $CODEVER"; exit -1; fi
-
if [[ $GITTAG != $CODEVERS ]]; then echo "VERSION NUMBER BAD $GITTAG != $CODEVER
S
"; exit -1; fi
tag
:
stage
:
build
...
...
This diff is collapsed.
Click to expand it.
utils/convert.go
+
4
−
0
View file @
a2c1fb23
...
...
@@ -32,6 +32,10 @@ func CopyBytesToJS(src []byte) js.Value {
// JsToJson converts the Javascript value to JSON.
func
JsToJson
(
value
js
.
Value
)
string
{
if
value
.
IsUndefined
()
{
return
"null"
}
return
JSON
.
Call
(
"stringify"
,
value
)
.
String
()
}
...
...
This diff is collapsed.
Click to expand it.
utils/convert_test.go
+
16
−
0
View file @
a2c1fb23
...
...
@@ -113,6 +113,22 @@ func TestJsToJson(t *testing.T) {
}
}
// Tests that JsToJson return a null object when the Javascript object is
// undefined.
func
TestJsToJson_Undefined
(
t
*
testing
.
T
)
{
expected
,
err
:=
json
.
Marshal
(
nil
)
if
err
!=
nil
{
t
.
Errorf
(
"Failed to JSON marshal test object: %+v"
,
err
)
}
jsJson
:=
JsToJson
(
js
.
Undefined
())
if
string
(
expected
)
!=
jsJson
{
t
.
Errorf
(
"Recieved incorrect JSON from Javascript object."
+
"
\n
expected: %s
\n
received: %s"
,
expected
,
jsJson
)
}
}
// Tests that JsonToJS can convert a JSON object with multiple types to a
// Javascript object and that all values match.
func
TestJsonToJS
(
t
*
testing
.
T
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment