Skip to content

Commit

Permalink
#689 Update to cli server to fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Budlee committed Jan 31, 2025
1 parent a32a1a8 commit 04da94e
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions cli/src/server/routes/validation-route.spec.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@



import request from 'supertest';
import * as fs from 'fs';

import express, { Application } from 'express';
import { ValidationRouter } from './validation-route';
import path from 'path';

const schemaDirectory = __dirname + '/../../../../calm';
const app: Application = express();
app.use(express.json());

const router: express.Router = express.Router();
new ValidationRouter(router, schemaDirectory);
app.use('/calm/validate', router);
const schemaDirectory : string = __dirname + '/../../../../calm';

describe('ValidationRouter', () => {
let app: Application;

beforeEach(() => {
app = express();
app.use(express.json());

const router: express.Router = express.Router();
new ValidationRouter(router, schemaDirectory);
app.use('/calm/validate', router);
});

test('should return 400 when $schema is not specified', async () => {
const expectedFilePath = path.join(__dirname, '../../../test_fixtures/validation_route/invalid_api_gateway_instantiation_missing_schema_key.json');
const invalidArchitectureMissingSchema = JSON.parse(
Expand Down

0 comments on commit 04da94e

Please sign in to comment.