Skip to content

Commit 3638ef5

Browse files
author
Tim Mendoza
committed
Change assets/verify_passcode.js to middleware/auth.js
1 parent 72fffc8 commit 3638ef5

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async function getAssets(folder) {
4646
});
4747

4848
const indexHTML = assets.find(asset => asset.name.includes('index.html'));
49-
const authHandlerFn = fs.readFileSync(path.join(__dirname, './serverless/assets/verify_passcode.js'));
49+
const authHandlerFn = fs.readFileSync(path.join(__dirname, './serverless/middleware/auth.js'));
5050

5151
const allAssets = assets.concat([
5252
{

test/serverless/assets/verify_passcode.test.js renamed to test/serverless/middleware/auth.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
const verifyPasscode = jest.requireActual('../../../src/serverless/assets/verify_passcode');
1+
const verifyPasscode = jest.requireActual('../../../src/serverless/middleware/auth');
22

3-
describe('the verify_passcode asset', () => {
3+
describe('the auth middleware', () => {
44
it('should return an "unauthorized" error when the passcode is incorrect', () => {
55
Date.now = () => 5;
66
const mockCallback = jest.fn();

test/setupTests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Response {
2121
global.Twilio = require('twilio');
2222
global.Twilio.Response = Response;
2323

24-
const verifyPasscodePath = `${__dirname}/../src/serverless/assets/verify_passcode.js`;
24+
const verifyPasscodePath = `${__dirname}/../src/serverless/middleware/auth.js`;
2525

2626
global.Runtime = {
2727
getAssets: () => ({
@@ -31,5 +31,5 @@ global.Runtime = {
3131
}),
3232
};
3333

34-
// Mocking this as a no-op since this function is tested in 'tests/serverless/assets/verify_passcode.ts'.
34+
// Mocking this as a no-op since this function is tested in 'tests/serverless/middleware/auth.ts'.
3535
jest.doMock(verifyPasscodePath, () => () => {});

0 commit comments

Comments
 (0)