Skip to content

Commit be487db

Browse files
author
CI Fix
committed
some cleaning
1 parent 128fc7c commit be487db

File tree

14 files changed

+28
-337
lines changed

14 files changed

+28
-337
lines changed

test-esm/index.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const __dirname = path.dirname(__filename)
1616
const TEST_HOSTS = ['nic.localhost', 'tim.localhost', 'nicola.localhost']
1717

1818
export function rm (file) {
19-
return rimraf.sync(path.normalize(path.join(__dirname, '../../test-esm/resources/' + file)))
19+
return rimraf.sync(path.normalize(path.join(__dirname, '../resources/' + file)))
2020
}
2121

2222
export function cleanDir (dirPath) {
@@ -31,17 +31,17 @@ export function cleanDir (dirPath) {
3131
}
3232

3333
export function write (text, file) {
34-
return fs.writeFileSync(path.normalize(path.join(__dirname, '../../test-esm/resources/' + file)), text)
34+
return fs.writeFileSync(path.normalize(path.join(__dirname, '../resources/' + file)), text)
3535
}
3636

3737
export function cp (src, dest) {
3838
return fs.copySync(
39-
path.normalize(path.join(__dirname, '../../test-esm/resources/' + src)),
40-
path.normalize(path.join(__dirname, '../../test-esm/resources/' + dest)))
39+
path.normalize(path.join(__dirname, '../resources/' + src)),
40+
path.normalize(path.join(__dirname, '../resources/' + dest)))
4141
}
4242

4343
export function read (file) {
44-
return fs.readFileSync(path.normalize(path.join(__dirname, '../../test-esm/resources/' + file)), {
44+
return fs.readFileSync(path.normalize(path.join(__dirname, '../resources/' + file)), {
4545
encoding: 'utf8'
4646
})
4747
}
@@ -165,4 +165,4 @@ function requestAdapter (arg1, arg2, arg3) {
165165
// Alias
166166
requestAdapter.del = requestAdapter.delete
167167

168-
export const httpRequest = requestAdapter
168+
export const httpRequest = requestAdapter

test-esm/integration/esm-app-test.mjs

Lines changed: 0 additions & 115 deletions
This file was deleted.

test-esm/integration/esm-app.test.mjs

Lines changed: 0 additions & 104 deletions
This file was deleted.

test-esm/integration/header-test.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('Header handler', () => {
1515
before(function () {
1616
this.timeout(20000)
1717
request = setupSupertestServer({
18-
root: join(__dirname, '../../test-esm/resources/headers'),
18+
root: join(__dirname, '../resources/headers'),
1919
multiuser: false,
2020
webid: true,
2121
sslKey: join(__dirname, '../../test/keys/key.pem'),
@@ -103,4 +103,4 @@ describe('Header handler', () => {
103103
})
104104
}
105105
}
106-
})
106+
})

test-esm/integration/http-test.mjs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const suffixMeta = '.meta'
2121
const server = setupSupertestServer({
2222
live: true,
2323
dataBrowserPath: 'default',
24-
root: path.join(__dirname, '../../test-esm/resources'),
24+
root: path.join(__dirname, '../resources'),
2525
auth: 'oidc',
2626
webid: false
2727
})
@@ -238,7 +238,7 @@ describe('HTTP APIs', function () {
238238
}
239239

240240
const size = fs.statSync(path.join(__dirname,
241-
'../../test-esm/resources/sampleContainer/solid.png')).size
241+
'../resources/sampleContainer/solid.png')).size
242242
if (res.body.length !== size) {
243243
return done(new Error('files are not of the same size'))
244244
}
@@ -548,7 +548,7 @@ describe('HTTP APIs', function () {
548548

549549
describe('PUT API', function () {
550550
const putRequestBody = fs.readFileSync(path.join(__dirname,
551-
'../../test-esm/resources/sampleContainer/put1.ttl'), {
551+
'../resources/sampleContainer/put1.ttl'), {
552552
encoding: 'utf8'
553553
})
554554
it('should create new resource with if-none-match on non existing resource', function (done) {
@@ -578,7 +578,7 @@ describe('HTTP APIs', function () {
578578
.expect(204)
579579
.end(function (err) {
580580
if (err) return done(err)
581-
if (fs.existsSync(path.join(__dirname, '../../test-esm/resources/put-resource-1.ttl$.txt'))) {
581+
if (fs.existsSync(path.join(__dirname, '../resources/put-resource-1.ttl$.txt'))) {
582582
return done(new Error('Can read old file that should have been deleted'))
583583
}
584584
done()
@@ -830,11 +830,11 @@ describe('HTTP APIs', function () {
830830
})
831831

832832
const postRequest1Body = fs.readFileSync(path.join(__dirname,
833-
'../../test-esm/resources/sampleContainer/put1.ttl'), {
833+
'../resources/sampleContainer/put1.ttl'), {
834834
encoding: 'utf8'
835835
})
836836
const postRequest2Body = fs.readFileSync(path.join(__dirname,
837-
'../../test-esm/resources/sampleContainer/post2.ttl'), {
837+
'../resources/sampleContainer/post2.ttl'), {
838838
encoding: 'utf8'
839839
})
840840
// Capture the resource name generated by server by parsing Location: header
@@ -874,7 +874,7 @@ describe('HTTP APIs', function () {
874874
try {
875875
postLocation = res.headers.location
876876
// console.log('location ' + postLocation)
877-
const createdDir = fs.statSync(path.join(__dirname, '../../test-esm/resources', postLocation.slice(0, -1)))
877+
const createdDir = fs.statSync(path.join(__dirname, '../resources', postLocation.slice(0, -1)))
878878
assert(createdDir.isDirectory(), 'Container should have been created')
879879
} catch (err) {
880880
return done(err)
@@ -987,7 +987,7 @@ describe('HTTP APIs', function () {
987987
try {
988988
postLocation = res.headers.location
989989
console.log('location ' + postLocation)
990-
const createdDir = fs.statSync(path.join(__dirname, '../../test-esm/resources', postLocation.slice(0, -1)))
990+
const createdDir = fs.statSync(path.join(__dirname, '../resources', postLocation.slice(0, -1)))
991991
assert(createdDir.isDirectory(), 'Container should have been created')
992992
} catch (err) {
993993
return done(err)
@@ -1053,7 +1053,7 @@ describe('HTTP APIs', function () {
10531053
try {
10541054
assert.equal(res.headers.location, expectedDirName,
10551055
'Uri container names should be encoded')
1056-
const createdDir = fs.statSync(path.join(__dirname, '../../test-esm/resources', expectedDirName))
1056+
const createdDir = fs.statSync(path.join(__dirname, '../resources', expectedDirName))
10571057
assert(createdDir.isDirectory(), 'Container should have been created')
10581058
} catch (err) {
10591059
return done(err)
@@ -1172,19 +1172,19 @@ describe('HTTP APIs', function () {
11721172
it('should create as many files as the ones passed in multipart',
11731173
function (done) {
11741174
server.post('/sampleContainer/')
1175-
.attach('timbl', path.join(__dirname, '../../test-esm/resources/timbl.jpg'))
1176-
.attach('nicola', path.join(__dirname, '../../test-esm/resources/nicola.jpg'))
1175+
.attach('timbl', path.join(__dirname, '../resources/timbl.jpg'))
1176+
.attach('nicola', path.join(__dirname, '../resources/nicola.jpg'))
11771177
.expect(200)
11781178
.end(function (err) {
11791179
if (err) return done(err)
11801180

11811181
const sizeNicola = fs.statSync(path.join(__dirname,
1182-
'../../test-esm/resources/nicola.jpg')).size
1183-
const sizeTim = fs.statSync(path.join(__dirname, '../../test-esm/resources/timbl.jpg')).size
1182+
'../resources/nicola.jpg')).size
1183+
const sizeTim = fs.statSync(path.join(__dirname, '../resources/timbl.jpg')).size
11841184
const sizeNicolaLocal = fs.statSync(path.join(__dirname,
1185-
'../../test-esm/resources/sampleContainer/nicola.jpg')).size
1185+
'../resources/sampleContainer/nicola.jpg')).size
11861186
const sizeTimLocal = fs.statSync(path.join(__dirname,
1187-
'../../test-esm/resources/sampleContainer/timbl.jpg')).size
1187+
'../resources/sampleContainer/timbl.jpg')).size
11881188

11891189
if (sizeNicola === sizeNicolaLocal && sizeTim === sizeTimLocal) {
11901190
return done()

test-esm/integration/patch-sparql-update-test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe('PATCH through application/sparql-update', function () {
3030

3131
it('should create a new file if file does not exist', function (done) {
3232
rm('sampleContainer/notExisting.ttl')
33-
const sampleContainerPath = path.join(__dirname, '../test-esm/resources/sampleContainer')
33+
const sampleContainerPath = path.join(__dirname, '/resources/sampleContainer')
3434
// fse.ensureDirSync(sampleContainerPath);
3535
server.patch('/notExisting.ttl')
3636
.set('content-type', 'application/sparql-update')

test-esm/integration/patch-test.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ const { read, rm, backup, restore } = await import('../utils.mjs')
1717
// Server settings
1818
const port = 7777
1919
const serverUri = `https://tim.localhost:${port}`
20-
const root = path.join(__dirname, '../../test-esm/resources/patch')
21-
const configPath = path.join(__dirname, '../../test-esm/resources/config')
20+
const root = path.join(__dirname, '../resources/patch')
21+
const configPath = path.join(__dirname, '../resources/config')
2222
const serverOptions = {
2323
root,
2424
configPath,

0 commit comments

Comments
 (0)