mirror of
https://github.com/badges/shields.git
synced 2025-04-18 19:44:04 +03:00
* chore(deps-dev): bump eslint-plugin-mocha from 10.4.1 to 10.4.2 Bumps [eslint-plugin-mocha](https://github.com/lo1tuma/eslint-plugin-mocha) from 10.4.1 to 10.4.2. - [Release notes](https://github.com/lo1tuma/eslint-plugin-mocha/releases) - [Changelog](https://github.com/lo1tuma/eslint-plugin-mocha/blob/10.4.2/CHANGELOG.md) - [Commits](https://github.com/lo1tuma/eslint-plugin-mocha/compare/10.4.1...10.4.2) --- updated-dependencies: - dependency-name: eslint-plugin-mocha dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * fix mocha/prefer-arrow-callback errors --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: chris48s <git@chris-shaw.dev>
37 lines
1.0 KiB
JavaScript
37 lines
1.0 KiB
JavaScript
import { test, given } from 'sazerac'
|
|
import PypiPythonVersions from './pypi-python-versions.service.js'
|
|
|
|
describe('PyPI Python Version', function () {
|
|
test(PypiPythonVersions.render, () => {
|
|
// Major versions are hidden if minor are present.
|
|
given({ versions: ['3', '3.4', '3.5', '3.6', '2', '2.7'] }).expect({
|
|
message: '2.7 | 3.4 | 3.5 | 3.6',
|
|
color: 'blue',
|
|
})
|
|
|
|
// Major versions are shown when minor are missing.
|
|
given({ versions: ['2', '3'] }).expect({
|
|
message: '2 | 3',
|
|
color: 'blue',
|
|
})
|
|
|
|
// Versions are properly sorted according to their Semver segments.
|
|
given({ versions: ['3.10', '3.9', '3.8', '3.7', '3.6'] }).expect({
|
|
message: '3.6 | 3.7 | 3.8 | 3.9 | 3.10',
|
|
color: 'blue',
|
|
})
|
|
|
|
// Only "one" version works too.
|
|
given({ versions: ['3', '3.9'] }).expect({
|
|
message: '3.9',
|
|
color: 'blue',
|
|
})
|
|
|
|
// Versions are missing...
|
|
given({ versions: [] }).expect({
|
|
message: 'missing',
|
|
color: 'red',
|
|
})
|
|
})
|
|
})
|