fix prettier

This commit is contained in:
Stefan
2024-12-20 15:48:25 +01:00
parent 0be3c45848
commit df7908fdc1
@@ -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);
}
});