Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rjs_json_form
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
rjs_json_form
Commits
463bbc9b
Commit
463bbc9b
authored
Aug 18, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: use replaceAll in tests for replace urls
parent
5ec49b94
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
test/jsonform_test.js
test/jsonform_test.js
+6
-1
test/jsonform_test_view.js
test/jsonform_test_view.js
+6
-1
No files found.
test/jsonform_test.js
View file @
463bbc9b
...
@@ -15,6 +15,11 @@
...
@@ -15,6 +15,11 @@
QUnit
.
config
.
autostart
=
false
;
QUnit
.
config
.
autostart
=
false
;
function
replaceAll
(
str
,
searchStr
,
replaceStr
)
{
searchStr
=
searchStr
.
replace
(
/
[\-\/\\\^
$*+?.()|
\[\]
{}
]
/g
,
'
\\
$&
'
);
return
str
.
replace
(
new
RegExp
(
searchStr
,
'
gi
'
),
replaceStr
);
}
function
downloadJSON
(
url
)
{
function
downloadJSON
(
url
)
{
return
RSVP
.
Queue
()
return
RSVP
.
Queue
()
.
push
(
function
()
{
.
push
(
function
()
{
...
@@ -263,7 +268,7 @@
...
@@ -263,7 +268,7 @@
m
=
list
[
i
][
k
];
m
=
list
[
i
][
k
];
skip_module
=
skip_modules
.
indexOf
(
m
.
description
)
>=
0
;
skip_module
=
skip_modules
.
indexOf
(
m
.
description
)
>=
0
;
module
(
m
.
description
);
module
(
m
.
description
);
schema
=
JSON
.
parse
(
JSON
.
stringify
(
m
.
schema
).
replace
(
"
http://localhost:1234/
"
,
schema
=
JSON
.
parse
(
replaceAll
(
JSON
.
stringify
(
m
.
schema
),
"
http://localhost:1234/
"
,
"
http://localhost:9000/node_modules/json-schema-test-suite/remotes/
"
));
"
http://localhost:9000/node_modules/json-schema-test-suite/remotes/
"
));
for
(
z
=
0
;
z
<
m
.
tests
.
length
;
z
+=
1
)
{
for
(
z
=
0
;
z
<
m
.
tests
.
length
;
z
+=
1
)
{
t
=
m
.
tests
[
z
];
t
=
m
.
tests
[
z
];
...
...
test/jsonform_test_view.js
View file @
463bbc9b
...
@@ -4,6 +4,11 @@
...
@@ -4,6 +4,11 @@
(
function
(
window
,
rJS
,
jIO
)
{
(
function
(
window
,
rJS
,
jIO
)
{
"
use strict
"
;
"
use strict
"
;
function
replaceAll
(
str
,
searchStr
,
replaceStr
)
{
searchStr
=
searchStr
.
replace
(
/
[\-\/\\\^
$*+?.()|
\[\]
{}
]
/g
,
'
\\
$&
'
);
return
str
.
replace
(
new
RegExp
(
searchStr
,
'
gi
'
),
replaceStr
);
}
function
downloadJSON
(
url
)
{
function
downloadJSON
(
url
)
{
return
RSVP
.
Queue
()
return
RSVP
.
Queue
()
.
push
(
function
()
{
.
push
(
function
()
{
...
@@ -104,7 +109,7 @@
...
@@ -104,7 +109,7 @@
m
=
list
[
i
][
k
];
m
=
list
[
i
][
k
];
g
.
props
.
schemas
.
push
(
m
.
description
);
g
.
props
.
schemas
.
push
(
m
.
description
);
g
.
props
.
documents
[
m
.
description
]
=
[];
g
.
props
.
documents
[
m
.
description
]
=
[];
schema
=
JSON
.
parse
(
JSON
.
stringify
(
m
.
schema
).
replace
(
"
http://localhost:1234/
"
,
schema
=
JSON
.
parse
(
replaceAll
(
JSON
.
stringify
(
m
.
schema
),
"
http://localhost:1234/
"
,
"
http://localhost:9000/node_modules/json-schema-test-suite/remotes/
"
));
"
http://localhost:9000/node_modules/json-schema-test-suite/remotes/
"
));
for
(
z
=
0
;
z
<
m
.
tests
.
length
;
z
+=
1
)
{
for
(
z
=
0
;
z
<
m
.
tests
.
length
;
z
+=
1
)
{
t
=
m
.
tests
[
z
];
t
=
m
.
tests
[
z
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment