Upgrade to Chai 5.x (#10732)

* remove chai-string plugin

* upgrade chai and sinon-chai

* update chai imports

* migrate badge-maker tests to ESM
This commit is contained in:
chris48s
2024-12-11 19:28:45 +00:00
committed by GitHub
parent 075f1b450e
commit fb816ecf93
14 changed files with 167 additions and 105 deletions

View File

@@ -1,8 +1,7 @@
import chai from 'chai'
import { expect, use } from 'chai'
import chaiAsPromised from 'chai-as-promised'
import jsonPath from './json-path.js'
const { expect } = chai
chai.use(chaiAsPromised)
use(chaiAsPromised)
describe('JSON Path service factory', function () {
describe('fetch()', function () {

View File

@@ -114,10 +114,11 @@ describe('Github token acceptor', function () {
const res = await got.post(`${baseUrl}/github-auth/done`, {
body: form,
})
expect(res.body).to.startWith(
'<p>Shields.io has received your app-specific GitHub user token.',
)
expect(
res.body.startsWith(
'<p>Shields.io has received your app-specific GitHub user token.',
),
).to.be.true
expect(onTokenAccepted).to.have.been.calledWith(fakeAccessToken)
})
})

View File

@@ -1,8 +1,7 @@
import chai from 'chai'
import { expect, use } from 'chai'
import chaiAsPromised from 'chai-as-promised'
import PackagistDependencyVersion from './packagist-dependency-version.service.js'
const { expect } = chai
chai.use(chaiAsPromised)
use(chaiAsPromised)
describe('PackagistDependencyVersion', function () {
const fullPackagistJson = {