Update bootstrap process to use vitest chai
GitOrigin-RevId: 5576223019c0e2b4554707f0025e82ab3a7ca514
This commit is contained in:
Vendored
+17
@@ -1,7 +1,24 @@
|
||||
const Path = require('path')
|
||||
const sinon = require('sinon')
|
||||
require('./common_bootstrap')
|
||||
const chai = require('chai')
|
||||
|
||||
/*
|
||||
* Chai configuration
|
||||
*/
|
||||
|
||||
// add chai.should()
|
||||
chai.should()
|
||||
|
||||
// Load sinon-chai assertions so expect(stubFn).to.have.been.calledWith('abc')
|
||||
// has a nicer failure messages
|
||||
chai.use(require('sinon-chai'))
|
||||
|
||||
// Load promise support for chai
|
||||
chai.use(require('chai-as-promised'))
|
||||
|
||||
// Do not truncate assertion errors
|
||||
chai.config.truncateThreshold = 0
|
||||
/*
|
||||
* Global stubs
|
||||
*/
|
||||
|
||||
@@ -1,22 +1,3 @@
|
||||
const chai = require('chai')
|
||||
|
||||
/*
|
||||
* Chai configuration
|
||||
*/
|
||||
|
||||
// add chai.should()
|
||||
chai.should()
|
||||
|
||||
// Load sinon-chai assertions so expect(stubFn).to.have.been.calledWith('abc')
|
||||
// has a nicer failure messages
|
||||
chai.use(require('sinon-chai'))
|
||||
|
||||
// Load promise support for chai
|
||||
chai.use(require('chai-as-promised'))
|
||||
|
||||
// Do not truncate assertion errors
|
||||
chai.config.truncateThreshold = 0
|
||||
|
||||
// add support for mongoose in sinon
|
||||
require('sinon-mongoose')
|
||||
|
||||
|
||||
@@ -1,8 +1,26 @@
|
||||
import { vi } from 'vitest'
|
||||
import { chai, vi } from 'vitest'
|
||||
import './common_bootstrap.js'
|
||||
import sinon from 'sinon'
|
||||
import logger from '@overleaf/logger'
|
||||
import sinonChai from 'sinon-chai'
|
||||
import chaiAsPromised from 'chai-as-promised'
|
||||
|
||||
/*
|
||||
* Chai configuration
|
||||
*/
|
||||
|
||||
// add chai.should()
|
||||
chai.should()
|
||||
|
||||
// Load sinon-chai assertions so expect(stubFn).to.have.been.calledWith('abc')
|
||||
// has a nicer failure messages
|
||||
chai.use(sinonChai)
|
||||
|
||||
// Load promise support for chai
|
||||
chai.use(chaiAsPromised)
|
||||
|
||||
// Do not truncate assertion errors
|
||||
chai.config.truncateThreshold = 0
|
||||
vi.mock('@overleaf/logger', async () => {
|
||||
return {
|
||||
default: {
|
||||
|
||||
Reference in New Issue
Block a user