Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
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
nexedi
converse.js
Commits
7eb6a17f
Commit
7eb6a17f
authored
Apr 21, 2020
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the ability to run tests via the webpack devserver
parent
65246d00
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
16 deletions
+60
-16
src/headless/converse-core.js
src/headless/converse-core.js
+0
-1
tests.html
tests.html
+33
-0
tests/index.html
tests/index.html
+1
-0
tests/mock.js
tests/mock.js
+0
-3
tests/runner.js
tests/runner.js
+21
-12
webpack.serve.js
webpack.serve.js
+5
-0
No files found.
src/headless/converse-core.js
View file @
7eb6a17f
...
...
@@ -28,7 +28,6 @@ const $iq = strophe.default.$iq;
const
$msg
=
strophe
.
default
.
$msg
;
const
$pres
=
strophe
.
default
.
$pres
;
dayjs
.
extend
(
advancedFormat
);
// Add Strophe Namespaces
...
...
tests.html
0 → 100644
View file @
7eb6a17f
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
Converse.js
</title>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
name=
"description"
content=
"Converse.js: A free chat client for your website"
/>
<script
src=
"3rdparty/libsignal-protocol.js"
></script>
<link
rel=
"manifest"
href=
"./manifest.json"
>
<link
rel=
"shortcut icon"
type=
"image/ico"
href=
"favicon.ico"
/>
<link
rel=
"shortcut icon"
type=
"image/png"
href=
"node_modules/jasmine-core/images/jasmine_favicon.png"
>
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"node_modules/jasmine-core/lib/jasmine-core/jasmine.css"
>
<script
data-main=
"tests/runner"
src=
"../node_modules/requirejs/require.js"
></script>
<style>
.tests-brand-heading
{
margin-top
:
1em
;
font-size
:
200%
;
}
</style>
</head>
<body
class=
"reset"
></body>
<div
id=
"header_wrap"
class=
"outer"
>
<header
class=
"inner"
>
<h1
class=
"brand-heading tests-brand-heading"
>
<i
class=
"icon-conversejs"
></i>
Converse
</h1>
<h2
id=
"project_tagline"
>
Tests
</h2>
</header>
</div>
<script>
converse
.
load
();
</script>
</html>
tests/index.html
View file @
7eb6a17f
...
...
@@ -25,5 +25,6 @@
<h2
id=
"project_tagline"
>
Tests
</h2>
</header>
</div>
<script>
converse
.
load
();
</script>
</body>
</html>
tests/mock.js
View file @
7eb6a17f
(
function
(
root
,
factory
)
{
define
(
"
mock
"
,
[],
factory
);
}(
this
,
function
()
{
converse
.
load
();
const
_
=
converse
.
env
.
_
;
const
u
=
converse
.
env
.
utils
;
const
Promise
=
converse
.
env
.
Promise
;
...
...
tests/runner.js
View file @
7eb6a17f
...
...
@@ -70,16 +70,25 @@ var specs = [
"
spec/xss
"
];
require
([
'
console-reporter
'
,
'
mock
'
,
'
sinon
'
],
(
ConsoleReporter
,
mock
,
sinon
)
=>
{
if
(
window
.
view_mode
)
{
mock
.
view_mode
=
window
.
view_mode
;
}
window
.
sinon
=
sinon
;
// Load the specs
require
(
specs
,
jasmine
=>
{
jasmine
.
DEFAULT_TIMEOUT_INTERVAL
=
7000
;
const
jasmineEnv
=
jasmine
.
getEnv
();
jasmineEnv
.
addReporter
(
new
ConsoleReporter
());
window
.
onload
();
function
load
()
{
require
([
'
console-reporter
'
,
'
mock
'
,
'
sinon
'
],
(
ConsoleReporter
,
mock
,
sinon
)
=>
{
if
(
window
.
view_mode
)
{
mock
.
view_mode
=
window
.
view_mode
;
}
window
.
sinon
=
sinon
;
// Load the specs
require
(
specs
,
jasmine
=>
{
jasmine
.
DEFAULT_TIMEOUT_INTERVAL
=
7000
;
const
jasmineEnv
=
jasmine
.
getEnv
();
jasmineEnv
.
addReporter
(
new
ConsoleReporter
());
window
.
onload
();
});
});
});
}
if
(
window
.
converse
)
{
load
();
}
else
{
window
.
addEventListener
(
'
converse-loaded
'
,
load
);
}
webpack.serve.js
View file @
7eb6a17f
...
...
@@ -13,6 +13,11 @@ module.exports = merge(common, {
new
HTMLWebpackPlugin
({
title
:
'
Converse.js Dev
'
,
template
:
'
webpack.html
'
}),
new
HTMLWebpackPlugin
({
filename
:
'
tests.html
'
,
title
:
'
Converse.js Tests
'
,
template
:
'
tests.html
'
})
],
});
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