Skip to content

Commit

Permalink
improve check schema
Browse files Browse the repository at this point in the history
  • Loading branch information
corsicanec82 committed Nov 14, 2022
1 parent cef8b6e commit 2cd7c73
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions __tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ describe('run-tests assignment', () => {
describe('run-post-actions', () => {
const checkCreatePath = 'http://localhost:3000/api_internal/courses/hexlet-course-source-ci/lessons/basics/assignment/check';
const checkData = {
testData: { passed: true, output: 'some testing output' },
lintData: { passed: false, output: 'some linting output' },
testData: { passed: true, output: 'some testing output', exception: null },
lintData: { passed: false, output: 'some linting output', exception: new Error('linting failed') },
};

it('success test state', async () => {
Expand Down
10 changes: 6 additions & 4 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,20 @@ const checkSchema = {
properties: {
passed: { type: 'boolean' },
output: { type: 'string', minLength: 1 },
exception: { type: 'object', nullable: true },
},
required: ['passed', 'output'],
additionalProperties: true,
required: ['passed', 'output', 'exception'],
additionalProperties: false,
},
lintData: {
type: 'object',
properties: {
passed: { type: 'boolean' },
output: { type: 'string', minLength: 1 },
exception: { type: 'object', nullable: true },
},
required: ['passed', 'output'],
additionalProperties: true,
required: ['passed', 'output', 'exception'],
additionalProperties: false,
},
},
required: ['state', 'testData', 'lintData'],
Expand Down

0 comments on commit 2cd7c73

Please sign in to comment.