Skip to content

Commit 6c0b43a

Browse files
committed
updating libapp in one script and tests
1 parent 6db9920 commit 6c0b43a

5 files changed

Lines changed: 13 additions & 13 deletions

File tree

script/enterprise-server-deprecations/archive-version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ async function main () {
155155
plugins: [new RewriteAssetPathsPlugin(version, tempDirectory)]
156156
}
157157

158-
app.listen(port, async () => {
158+
app().listen(port, async () => {
159159
console.log(`started server on ${host}`)
160160

161161
await scrape(scraperOptions).catch(err => {

tests/helpers/supertest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const app = require('../../lib/app')
77

88
const helpers = {}
99

10-
const request = (method, route) => supertest(app)[method](route)
10+
const request = (method, route) => supertest(app())[method](route)
1111

1212
helpers.get = async function (route, opts = { followRedirects: false, followAllRedirects: false, headers: {} }) {
1313
let res = (opts.headers) ? await request('get', route).set(opts.headers) : await request('get', route)

tests/rendering/events.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe('POST /events', () => {
1414
process.env.AIRTABLE_BASE_KEY = '$AIRTABLE_BASE_KEY$'
1515
process.env.HYDRO_SECRET = '$HYDRO_SECRET$'
1616
process.env.HYDRO_ENDPOINT = 'http://example.com/hydro'
17-
agent = request.agent(app)
17+
agent = request.agent(app())
1818
const csrfRes = await agent.get('/en')
1919
const $ = cheerio.load(csrfRes.text || '', { xmlMode: true })
2020
csrfToken = $('meta[name="csrf-token"]').attr('content')

tests/routing/deprecated-enterprise-versions.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ describe('does not render survey prompt or contribution button', () => {
126126

127127
describe('JS and CSS assets', () => {
128128
it('returns the expected CSS file > 2.18', async () => {
129-
const result = await supertest(app)
129+
const result = await supertest(app())
130130
.get('/enterprise/2.18/dist/index.css')
131131
.set('Referrer', '/en/enterprise/2.18')
132132

@@ -136,7 +136,7 @@ describe('JS and CSS assets', () => {
136136
})
137137

138138
it('returns the expected CSS file', async () => {
139-
const result = await supertest(app)
139+
const result = await supertest(app())
140140
.get('/stylesheets/index.css')
141141
.set('Referrer', '/en/enterprise/2.13')
142142

@@ -146,7 +146,7 @@ describe('JS and CSS assets', () => {
146146
})
147147

148148
it('returns the expected JS file > 2.18', async () => {
149-
const result = await supertest(app)
149+
const result = await supertest(app())
150150
.get('/enterprise/2.18/dist/index.js')
151151
.set('Referrer', '/en/enterprise/2.18')
152152

@@ -156,7 +156,7 @@ describe('JS and CSS assets', () => {
156156
})
157157

158158
it('returns the expected JS file', async () => {
159-
const result = await supertest(app)
159+
const result = await supertest(app())
160160
.get('/javascripts/index.js')
161161
.set('Referrer', '/en/enterprise/2.13')
162162

@@ -166,7 +166,7 @@ describe('JS and CSS assets', () => {
166166
})
167167

168168
it('returns the expected image', async () => {
169-
const result = await supertest(app)
169+
const result = await supertest(app())
170170
.get('/assets/images/octicons/hamburger.svg')
171171
.set('Referrer', '/en/enterprise/2.17')
172172

@@ -176,7 +176,7 @@ describe('JS and CSS assets', () => {
176176
})
177177

178178
it('returns the expected node_modules', async () => {
179-
const result = await supertest(app)
179+
const result = await supertest(app())
180180
.get('/node_modules/algoliasearch/dist/algoliasearch.min.js')
181181
.set('Referrer', '/en/enterprise/2.17')
182182

@@ -186,7 +186,7 @@ describe('JS and CSS assets', () => {
186186
})
187187

188188
it('returns the expected favicon', async () => {
189-
const result = await supertest(app)
189+
const result = await supertest(app())
190190
.get('/assets/images/site/favicon.svg')
191191
.set('Referrer', '/en/enterprise/2.18')
192192

@@ -196,7 +196,7 @@ describe('JS and CSS assets', () => {
196196
})
197197

198198
it('returns the expected CSS file ( <2.13 )', async () => {
199-
const result = await supertest(app)
199+
const result = await supertest(app())
200200
.get('/assets/stylesheets/application.css')
201201
.set('Referrer', '/en/enterprise/2.12')
202202

@@ -206,7 +206,7 @@ describe('JS and CSS assets', () => {
206206
})
207207

208208
it('ignores invalid paths', async () => {
209-
const result = await supertest(app)
209+
const result = await supertest(app())
210210
.get('/pizza/index.css')
211211
.set('Referrer', '/en/enterprise/2.13')
212212

tests/routing/redirects.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ describe('redirects', () => {
103103
})
104104

105105
test('are redirected for HEAD requests (not just GET requests)', async () => {
106-
const res = await supertest(app).head('/articles/closing-issues-via-commit-messages/')
106+
const res = await supertest(app()).head('/articles/closing-issues-via-commit-messages/')
107107
expect(res.statusCode).toBe(301)
108108
expect(res.headers.location).toBe('/articles/closing-issues-via-commit-messages')
109109
})

0 commit comments

Comments
 (0)