-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update caveats about tests and requirements
- Loading branch information
1 parent
53eec77
commit 556d950
Showing
8 changed files
with
79 additions
and
54 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
This file was deleted.
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,23 @@ | ||
// loadConfig.test.js | ||
import { loadConfig } from './loadConfig'; | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
|
||
jest.mock('fs'); | ||
jest.mock('path'); | ||
|
||
describe('loadConfig', () => { | ||
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
it('loads and parses a valid config file', () => { | ||
fs.readFileSync.mockReturnValue(JSON.stringify({ include: ['test'] })); | ||
path.resolve.mockReturnValue('path/to/config.json'); | ||
|
||
const config = loadConfig('config.json'); | ||
expect(config).toEqual({ include: ['test'] }); | ||
}); | ||
|
||
// More tests for error handling... | ||
}); |
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,19 @@ | ||
// main.test.js | ||
import yargs from 'yargs'; | ||
import { hideBin } from 'yargs/helpers'; | ||
import main from './main'; | ||
|
||
jest.mock('yargs'); | ||
jest.mock('hideBin'); | ||
|
||
describe('main CLI', () => { | ||
it('registers commands and options', () => { | ||
// Call main and inspect yargs configuration | ||
main(); | ||
expect(yargs.command).toHaveBeenCalled(); | ||
expect(yargs.option).toHaveBeenCalled(); | ||
// Add more expectations based on your yargs setup | ||
}); | ||
|
||
// More tests for CLI behavior... | ||
}); |
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,25 @@ | ||
// validate.test.js | ||
import validate, { readSchemaFile, isSchemaValid } from '../commands/validate'; | ||
import avro from 'avsc'; | ||
import fs from 'fs'; | ||
import { glob } from 'glob'; | ||
import chalk from 'chalk'; | ||
|
||
jest.mock('fs'); | ||
jest.mock('avsc'); | ||
jest.mock('glob'); | ||
|
||
describe('validate command', () => { | ||
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
it('readSchemaFile reads and returns schema file content', () => { | ||
fs.readFileSync.mockReturnValue('{"type": "record"}'); | ||
const content = readSchemaFile('path/to/schema.avsc'); | ||
expect(content).toBe('{"type": "record"}'); | ||
expect(fs.readFileSync).toHaveBeenCalledWith('path/to/schema.avsc', 'utf8'); | ||
}); | ||
|
||
// More tests for isSchemaValid and the command handler... | ||
}); |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,9 @@ | |
"**/?(*.)+(spec|test).[tj]s?(x)" | ||
] | ||
}, | ||
"engines": { | ||
"node": ">=14" | ||
}, | ||
"release": { | ||
"branches": [ | ||
{ | ||
|