mirror of
https://github.com/gorules/zen.git
synced 2026-10-04 16:02:18 +00:00
fix prettier
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import {describe} from 'node:test';
|
||||
import {expect, test} from '@jest/globals';
|
||||
import {getCargoVersion, updateCargoContents} from './cargo';
|
||||
import {inc, ReleaseType} from 'semver';
|
||||
import { describe } from 'node:test';
|
||||
import { expect, test } from '@jest/globals';
|
||||
import { getCargoVersion, updateCargoContents } from './cargo';
|
||||
import { inc, ReleaseType } from 'semver';
|
||||
import * as fs from 'fs/promises';
|
||||
import * as path from 'path';
|
||||
|
||||
// language=Toml
|
||||
const makeToml = ({version}): string => `
|
||||
const makeToml = ({ version }): string => `
|
||||
[package]
|
||||
authors = ["GoRules Team <bot@gorules.io>"]
|
||||
description = "Business rules engine"
|
||||
@@ -34,21 +34,21 @@ const makeToml = ({version}): string => `
|
||||
describe('GitHub Action', () => {
|
||||
test('Bumps package', () => {
|
||||
const version = '0.2.0';
|
||||
const initialToml = makeToml({version});
|
||||
const initialToml = makeToml({ version });
|
||||
|
||||
const releases: ReleaseType[] = ['major', 'minor', 'patch'];
|
||||
for (const release of releases) {
|
||||
const newVersion = inc(version, release);
|
||||
const expectedToml = makeToml({version: newVersion});
|
||||
const expectedToml = makeToml({ version: newVersion });
|
||||
|
||||
expect(updateCargoContents(initialToml, {version: newVersion})).toEqual(expectedToml);
|
||||
expect(updateCargoContents(initialToml, { version: newVersion })).toEqual(expectedToml);
|
||||
}
|
||||
});
|
||||
|
||||
test('Extracts package version', () => {
|
||||
const versions = ['0.1.0', '0.2.0', '0.3.0'];
|
||||
for (const version of versions) {
|
||||
const versionedToml = makeToml({version});
|
||||
const versionedToml = makeToml({ version });
|
||||
expect(getCargoVersion(versionedToml)).toEqual(version);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user