Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Site
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
24
Issues
24
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Indienet
Site
Commits
1e7d2cc9
Verified
Commit
1e7d2cc9
authored
Mar 17, 2018
by
Aral Balkan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove old server test folder
parent
09ae4d7c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
109 deletions
+0
-109
test/app.test.js
test/app.test.js
+0
-86
test/services/site-configuration.test.js
test/services/site-configuration.test.js
+0
-23
No files found.
test/app.test.js
deleted
100644 → 0
View file @
09ae4d7c
// @ts-check
/* global describe, before, after, it */
process
.
env
.
NODE_ENV
=
'
test
'
const
assert
=
require
(
'
assert
'
)
const
request
=
require
(
'
request-promise
'
)
const
url
=
require
(
'
url
'
)
const
app
=
require
(
'
../server/app
'
)
//
// Helpers
//
const
port
=
app
.
get
(
'
port
'
)
||
3030
const
urlFor
=
pathname
=>
url
.
format
({
hostname
:
app
.
get
(
'
host
'
)
||
'
localhost
'
,
protocol
:
'
http
'
,
port
,
pathname
})
const
assertActor
=
body
=>
{
const
owner
=
JSON
.
parse
(
body
)
assert
.
equal
(
owner
[
'
@context
'
],
'
https://www.w3.org/ns/activitystreams
'
)
assert
.
equal
(
owner
.
type
,
'
Person
'
)
}
const
mainActivityPubContentType
=
'
application/ld+json; profile="https://www.w3.org/ns/activitystreams"
'
const
alternativeActivityPubContentType
=
'
application/activity+json
'
const
resource
=
({
path
,
accept
})
=>
{
return
{
url
:
urlFor
(
path
),
headers
:
{
'
Accept
'
:
accept
}
}
}
describe
(
'
Indie Site
'
,
()
=>
{
before
(
function
(
done
)
{
this
.
server
=
app
.
listen
(
port
)
this
.
server
.
once
(
'
listening
'
,
()
=>
done
())
})
after
(
function
(
done
)
{
this
.
server
.
close
(
done
)
})
describe
(
'
Index
'
,
()
=>
{
it
(
'
Returns Actor object for ActivityPub request with main content-type.
'
,
()
=>
{
return
request
(
resource
({
path
:
'
/
'
,
accept
:
mainActivityPubContentType
})).
then
(
body
=>
assertActor
(
body
))
})
it
(
'
Returns Actor object for ActivityPub request with alternative content type.
'
,
()
=>
{
return
request
(
resource
({
path
:
'
/
'
,
accept
:
alternativeActivityPubContentType
})).
then
(
body
=>
assertActor
(
body
))
})
})
describe
(
'
404
'
,
function
()
{
it
(
'
Shows a 404 HTML page.
'
,
()
=>
{
return
request
({
url
:
urlFor
(
'
path/to/nowhere
'
),
headers
:
{
'
Accept
'
:
'
text/html
'
}
}).
catch
(
res
=>
{
assert
.
equal
(
res
.
statusCode
,
404
)
assert
.
ok
(
res
.
error
.
indexOf
(
'
<html>
'
)
!==
-
1
)
})
})
it
(
'
Shows a 404 JSON error without stack trace.
'
,
()
=>
{
return
request
({
url
:
urlFor
(
'
path/to/nowhere
'
),
json
:
true
}).
catch
(
res
=>
{
assert
.
equal
(
res
.
statusCode
,
404
)
assert
.
equal
(
res
.
error
.
code
,
404
)
assert
.
equal
(
res
.
error
.
message
,
'
Page not found
'
)
assert
.
equal
(
res
.
error
.
name
,
'
NotFound
'
)
})
})
})
})
test/services/site-configuration.test.js
deleted
100644 → 0
View file @
09ae4d7c
// @ts-check
/* global describe, it */
const
assert
=
require
(
'
assert
'
)
const
app
=
require
(
'
../../server/app
'
)
const
siteConfiguration
=
require
(
'
../../client/assets/data.json
'
)
describe
(
'
site-configuration service
'
,
()
=>
{
it
(
'
registered the service
'
,
()
=>
{
const
service
=
app
.
service
(
'
site-configuration
'
)
assert
.
ok
(
service
,
'
Registered the service
'
)
})
it
(
'
returns correct site configuration
'
,
async
()
=>
{
const
service
=
app
.
service
(
'
site-configuration
'
)
const
siteConfigrationFromService
=
await
service
.
find
()
assert
.
deepStrictEqual
(
siteConfiguration
,
siteConfigrationFromService
)
})
})
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