Skip to content

Commit

Permalink
spec: rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkeyl committed Jan 16, 2025
1 parent 0863807 commit 42847b4
Showing 1 changed file with 49 additions and 25 deletions.
74 changes: 49 additions & 25 deletions specs/define-config.spec.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,57 @@
import { describe, expect, test as spec } from 'bun:test';

import { defineConfig } from '#src/index.ts';
import type { UserConfig } from '#types/user-config.ts';

describe('Semantic Release Config', async () => {
spec('should return empty config', async () => {
expect(defineConfig({}));
describe('Semantic Release Config', () => {
spec('should return empty config', () => {
const config = defineConfig({});

expect(config).toMatchObject({});
expect(config satisfies UserConfig).toBeDefined();
});

spec('should return config', async () => {
expect(
defineConfig({
branches: [
'main',
{
channel: 'next',
name: 'alpha',
prerelease: true,
range: '',
},
],
ci: false,
debug: false,
dryRun: false,
extends: [],
plugins: [],
preset: '',
repositoryUrl: '',
tagFormat: '',
}),
);
spec('should return config with all properties', () => {
const config = defineConfig({
branches: [
'main',
{
channel: 'next',
name: 'alpha',
prerelease: true,
range: '',
},
],
ci: false,
debug: false,
dryRun: false,
extends: [],
plugins: [],
preset: '',
repositoryUrl: '',
tagFormat: '',
});

expect(config).toMatchObject({
branches: [
'main',
{
channel: 'next',
name: 'alpha',
prerelease: true,
range: '',
},
],
ci: false,
debug: false,
dryRun: false,
extends: [],
plugins: [],
preset: '',
repositoryUrl: '',
tagFormat: '',
});

expect(config satisfies UserConfig).toBeDefined();
});
});

0 comments on commit 42847b4

Please sign in to comment.