-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix node_modules + typescript + ESM issues for real
There were some weird issues with esbuild earlier resolving node_modules in cjs form incorrectly leading to require() statements inside the bundled index.js. Due to production issues, hacks were made to allow a deploy but those have been reverted and now this is an attempt to correctly fix the resolution issues. If this does not work, we should look at things like shimming require() as listed in evanw/esbuild#1921 (comment) and explained in: evanw/esbuild#3637 (comment)
- Loading branch information
Showing
5 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import * as TestingUtils from './utils/testing'; | ||
|
||
describe('transcript', () => { | ||
it('GET retrieves transcript', async () => { | ||
const response = await TestingUtils.fetchEndpoint( | ||
'transcript', | ||
'GET', | ||
{ category: 'sps-board', | ||
vid: 'MT2zjpRbQJA' }); | ||
expect(response.status).toStrictEqual(200); | ||
const responseJson = await response.json(); | ||
expect(responseJson.ok).toStrictEqual(true); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import * as TestingUtils from './utils/testing'; | ||
import { getCategoryPrivateDb } from './utils/firebase'; | ||
import { getAllCategories } from './utils/path'; | ||
|
||
describe('video_queue', () => { | ||
beforeAll(TestingUtils.beforeAll); | ||
|
||
it('Access With auth_code', async () => { | ||
const NEW_VIDS = ['a','b','c']; | ||
const category = getAllCategories()[0]; | ||
getCategoryPrivateDb(category, 'new_vids').set(NEW_VIDS); | ||
const response = await TestingUtils.fetchEndpoint( | ||
'video_queue', | ||
'GET', | ||
{ user_id: TestingUtils.FAKE_USER_ID, | ||
auth_code: TestingUtils.FAKE_AUTH_CODE }); | ||
expect(response.status).toStrictEqual(200); | ||
const responseJson = await response.json(); | ||
expect(responseJson.ok).toStrictEqual(true); | ||
expect(responseJson.data[category]).toEqual(NEW_VIDS); | ||
}); | ||
|
||
}); |