mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
[libraries] align test setup (#29009)
* [libraries] move all the unit tests into test/unit * [settings] remove empty test file * [mongo-utils] remove test setup as there are no tests * [libraries] ensure that all libraries with tests have test/setup.js * [monorepo] remove test step from Cloud build for libraries without tests GitOrigin-RevId: b9a0a8a3330db7d8646c7a272b03fbb8c5e44bc0
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
// no setup yet
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
const chai = require('chai')
|
|
||||||
const sinonChai = require('sinon-chai')
|
|
||||||
const SandboxedModule = require('sandboxed-module')
|
|
||||||
|
|
||||||
// Chai configuration
|
|
||||||
chai.should()
|
|
||||||
chai.use(sinonChai)
|
|
||||||
|
|
||||||
SandboxedModule.configure({
|
|
||||||
globals: { Buffer, JSON, console, process },
|
|
||||||
})
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
// no setup yet
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
const { promisify } = require('node:util')
|
const { promisify } = require('node:util')
|
||||||
|
|
||||||
const OError = require('..')
|
const OError = require('../..')
|
||||||
|
|
||||||
const {
|
const {
|
||||||
expectError,
|
expectError,
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
|
|
||||||
const OError = require('..')
|
const OError = require('../..')
|
||||||
const {
|
const {
|
||||||
expectError,
|
expectError,
|
||||||
expectFullStackWithoutStackFramesToEqual,
|
expectFullStackWithoutStackFramesToEqual,
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
|
|
||||||
const OError = require('../..')
|
const OError = require('../../..')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Error} e
|
* @param {Error} e
|
||||||
@@ -2,5 +2,5 @@
|
|||||||
"ui": "bdd",
|
"ui": "bdd",
|
||||||
"recursive": "true",
|
"recursive": "true",
|
||||||
"reporter": "spec",
|
"reporter": "spec",
|
||||||
"require": "./test/Init"
|
"require": "./test/setup"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
// no setup yet
|
||||||
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
const { AddCommentOperation, DeleteCommentOperation } = require('..')
|
const { AddCommentOperation, DeleteCommentOperation } = require('../..')
|
||||||
const Range = require('../lib/range')
|
const Range = require('../../lib/range')
|
||||||
const StringFileData = require('../lib/file_data/string_file_data')
|
const StringFileData = require('../../lib/file_data/string_file_data')
|
||||||
|
|
||||||
describe('AddCommentOperation', function () {
|
describe('AddCommentOperation', function () {
|
||||||
it('constructs an AddCommentOperation fromJSON', function () {
|
it('constructs an AddCommentOperation fromJSON', function () {
|
||||||
+1
-1
@@ -9,7 +9,7 @@ const {
|
|||||||
Snapshot,
|
Snapshot,
|
||||||
Origin,
|
Origin,
|
||||||
RestoreFileOrigin,
|
RestoreFileOrigin,
|
||||||
} = require('..')
|
} = require('../..')
|
||||||
|
|
||||||
describe('Change', function () {
|
describe('Change', function () {
|
||||||
describe('findBlobHashes', function () {
|
describe('findBlobHashes', function () {
|
||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
const Comment = require('../lib/comment')
|
const Comment = require('../../lib/comment')
|
||||||
const Range = require('../lib/range')
|
const Range = require('../../lib/range')
|
||||||
|
|
||||||
describe('Comment', function () {
|
describe('Comment', function () {
|
||||||
it('should move ranges to the right of insert', function () {
|
it('should move ranges to the right of insert', function () {
|
||||||
+3
-3
@@ -2,9 +2,9 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
const CommentList = require('../lib/file_data/comment_list')
|
const CommentList = require('../../lib/file_data/comment_list')
|
||||||
const Comment = require('../lib/comment')
|
const Comment = require('../../lib/comment')
|
||||||
const Range = require('../lib/range')
|
const Range = require('../../lib/range')
|
||||||
|
|
||||||
describe('commentList', function () {
|
describe('commentList', function () {
|
||||||
it('checks if toRaw() returns a correct comment list', function () {
|
it('checks if toRaw() returns a correct comment list', function () {
|
||||||
+4
-4
@@ -1,9 +1,9 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
const { AddCommentOperation, DeleteCommentOperation } = require('..')
|
const { AddCommentOperation, DeleteCommentOperation } = require('../..')
|
||||||
const Comment = require('../lib/comment')
|
const Comment = require('../../lib/comment')
|
||||||
const StringFileData = require('../lib/file_data/string_file_data')
|
const StringFileData = require('../../lib/file_data/string_file_data')
|
||||||
const Range = require('../lib/range')
|
const Range = require('../../lib/range')
|
||||||
|
|
||||||
describe('DeleteCommentOperation', function () {
|
describe('DeleteCommentOperation', function () {
|
||||||
it('constructs an DeleteCommentOperation fromJSON', function () {
|
it('constructs an DeleteCommentOperation fromJSON', function () {
|
||||||
+3
-3
@@ -3,9 +3,9 @@
|
|||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
const {
|
const {
|
||||||
getDocUpdaterCompatibleRanges,
|
getDocUpdaterCompatibleRanges,
|
||||||
} = require('../lib/doc_updater_compatible_ranges.js')
|
} = require('../../lib/doc_updater_compatible_ranges.js')
|
||||||
const StringFileData = require('../lib/file_data/string_file_data.js')
|
const StringFileData = require('../../lib/file_data/string_file_data.js')
|
||||||
const File = require('../lib/file.js')
|
const File = require('../../lib/file.js')
|
||||||
|
|
||||||
describe('getDocUpdaterCompatibleRanges', function () {
|
describe('getDocUpdaterCompatibleRanges', function () {
|
||||||
describe('with tracked deletes', function () {
|
describe('with tracked deletes', function () {
|
||||||
+2
-2
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
|
|
||||||
const ot = require('..')
|
const ot = require('../..')
|
||||||
const EditOperationBuilder = require('../lib/operation/edit_operation_builder')
|
const EditOperationBuilder = require('../../lib/operation/edit_operation_builder')
|
||||||
const File = ot.File
|
const File = ot.File
|
||||||
const Operation = ot.Operation
|
const Operation = ot.Operation
|
||||||
|
|
||||||
+9
-9
@@ -1,15 +1,15 @@
|
|||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
const EditOperationBuilder = require('../lib/operation/edit_operation_builder')
|
const EditOperationBuilder = require('../../lib/operation/edit_operation_builder')
|
||||||
const TextOperation = require('../lib/operation/text_operation')
|
const TextOperation = require('../../lib/operation/text_operation')
|
||||||
const EditOperationTransformer = require('../lib/operation/edit_operation_transformer')
|
const EditOperationTransformer = require('../../lib/operation/edit_operation_transformer')
|
||||||
const EditOperation = require('../lib/operation/edit_operation')
|
const EditOperation = require('../../lib/operation/edit_operation')
|
||||||
const randomTextOperation = require('./support/random_text_operation')
|
const randomTextOperation = require('./support/random_text_operation')
|
||||||
const random = require('./support/random')
|
const random = require('./support/random')
|
||||||
const AddCommentOperation = require('../lib/operation/add_comment_operation')
|
const AddCommentOperation = require('../../lib/operation/add_comment_operation')
|
||||||
const DeleteCommentOperation = require('../lib/operation/delete_comment_operation')
|
const DeleteCommentOperation = require('../../lib/operation/delete_comment_operation')
|
||||||
const SetCommentStateOperation = require('../lib/operation/set_comment_state_operation')
|
const SetCommentStateOperation = require('../../lib/operation/set_comment_state_operation')
|
||||||
const Range = require('../lib/range')
|
const Range = require('../../lib/range')
|
||||||
const EditNoOperation = require('../lib/operation/edit_no_operation')
|
const EditNoOperation = require('../../lib/operation/edit_no_operation')
|
||||||
|
|
||||||
describe('EditOperation', function () {
|
describe('EditOperation', function () {
|
||||||
it('Cannot be instantiated', function () {
|
it('Cannot be instantiated', function () {
|
||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
const FakeBlobStore = require('./support/fake_blob_store')
|
const FakeBlobStore = require('./support/fake_blob_store')
|
||||||
const ot = require('..')
|
const ot = require('../..')
|
||||||
const File = ot.File
|
const File = ot.File
|
||||||
|
|
||||||
describe('File', function () {
|
describe('File', function () {
|
||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
const _ = require('lodash')
|
const _ = require('lodash')
|
||||||
|
|
||||||
const ot = require('..')
|
const ot = require('../..')
|
||||||
const File = ot.File
|
const File = ot.File
|
||||||
const FileMap = ot.FileMap
|
const FileMap = ot.FileMap
|
||||||
|
|
||||||
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
const HashFileData = require('../lib/file_data/hash_file_data')
|
const HashFileData = require('../../lib/file_data/hash_file_data')
|
||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
const StringFileData = require('../lib/file_data/string_file_data')
|
const StringFileData = require('../../lib/file_data/string_file_data')
|
||||||
const sinon = require('sinon')
|
const sinon = require('sinon')
|
||||||
const Blob = require('../lib/blob')
|
const Blob = require('../../lib/blob')
|
||||||
|
|
||||||
describe('HashFileData', function () {
|
describe('HashFileData', function () {
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
const core = require('..')
|
const core = require('../..')
|
||||||
const Change = core.Change
|
const Change = core.Change
|
||||||
const File = core.File
|
const File = core.File
|
||||||
const History = core.History
|
const History = core.History
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
const ot = require('..')
|
const ot = require('../..')
|
||||||
const HollowStringFileData = require('../lib/file_data/hollow_string_file_data')
|
const HollowStringFileData = require('../../lib/file_data/hollow_string_file_data')
|
||||||
const TextOperation = ot.TextOperation
|
const TextOperation = ot.TextOperation
|
||||||
|
|
||||||
describe('HollowStringFileData', function () {
|
describe('HollowStringFileData', function () {
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
const ot = require('..')
|
const ot = require('../..')
|
||||||
const Label = ot.Label
|
const Label = ot.Label
|
||||||
|
|
||||||
describe('Label', function () {
|
describe('Label', function () {
|
||||||
+3
-3
@@ -5,11 +5,11 @@ const _ = require('lodash')
|
|||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
const sinon = require('sinon')
|
const sinon = require('sinon')
|
||||||
|
|
||||||
const ot = require('..')
|
const ot = require('../..')
|
||||||
const File = ot.File
|
const File = ot.File
|
||||||
const TextOperation = ot.TextOperation
|
const TextOperation = ot.TextOperation
|
||||||
const LazyStringFileData = require('../lib/file_data/lazy_string_file_data')
|
const LazyStringFileData = require('../../lib/file_data/lazy_string_file_data')
|
||||||
const EagerStringFileData = require('../lib/file_data/string_file_data')
|
const EagerStringFileData = require('../../lib/file_data/string_file_data')
|
||||||
|
|
||||||
describe('LazyStringFileData', function () {
|
describe('LazyStringFileData', function () {
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
const ot = require('..')
|
const ot = require('../..')
|
||||||
const File = ot.File
|
const File = ot.File
|
||||||
const MoveFileOperation = ot.MoveFileOperation
|
const MoveFileOperation = ot.MoveFileOperation
|
||||||
const Snapshot = ot.Snapshot
|
const Snapshot = ot.Snapshot
|
||||||
+2
-2
@@ -3,8 +3,8 @@
|
|||||||
const _ = require('lodash')
|
const _ = require('lodash')
|
||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
|
|
||||||
const ot = require('..')
|
const ot = require('../..')
|
||||||
const StringFileData = require('../lib/file_data/string_file_data')
|
const StringFileData = require('../../lib/file_data/string_file_data')
|
||||||
const File = ot.File
|
const File = ot.File
|
||||||
const AddFileOperation = ot.AddFileOperation
|
const AddFileOperation = ot.AddFileOperation
|
||||||
const MoveFileOperation = ot.MoveFileOperation
|
const MoveFileOperation = ot.MoveFileOperation
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
const Range = require('../lib/range')
|
const Range = require('../../lib/range')
|
||||||
|
|
||||||
describe('Range', function () {
|
describe('Range', function () {
|
||||||
it('should create a range', function () {
|
it('should create a range', function () {
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
const ot = require('..')
|
const ot = require('../..')
|
||||||
const safePathname = ot.safePathname
|
const safePathname = ot.safePathname
|
||||||
|
|
||||||
describe('safePathname', function () {
|
describe('safePathname', function () {
|
||||||
+3
-3
@@ -5,9 +5,9 @@ const {
|
|||||||
ScanOp,
|
ScanOp,
|
||||||
InsertOp,
|
InsertOp,
|
||||||
RemoveOp,
|
RemoveOp,
|
||||||
} = require('../lib/operation/scan_op')
|
} = require('../../lib/operation/scan_op')
|
||||||
const { UnprocessableError, ApplyError } = require('../lib/errors')
|
const { UnprocessableError, ApplyError } = require('../../lib/errors')
|
||||||
const TrackingProps = require('../lib/file_data/tracking_props')
|
const TrackingProps = require('../../lib/file_data/tracking_props')
|
||||||
|
|
||||||
describe('ScanOp', function () {
|
describe('ScanOp', function () {
|
||||||
describe('fromJSON', function () {
|
describe('fromJSON', function () {
|
||||||
+1
-1
@@ -7,7 +7,7 @@ const {
|
|||||||
TextOperation,
|
TextOperation,
|
||||||
Change,
|
Change,
|
||||||
EditFileOperation,
|
EditFileOperation,
|
||||||
} = require('..')
|
} = require('../..')
|
||||||
|
|
||||||
describe('Snapshot', function () {
|
describe('Snapshot', function () {
|
||||||
describe('findBlobHashes', function () {
|
describe('findBlobHashes', function () {
|
||||||
+2
-2
@@ -4,8 +4,8 @@
|
|||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
const _ = require('lodash')
|
const _ = require('lodash')
|
||||||
|
|
||||||
const ot = require('..')
|
const ot = require('../..')
|
||||||
const StringFileData = require('../lib/file_data/string_file_data')
|
const StringFileData = require('../../lib/file_data/string_file_data')
|
||||||
const TextOperation = ot.TextOperation
|
const TextOperation = ot.TextOperation
|
||||||
|
|
||||||
describe('StringFileData', function () {
|
describe('StringFileData', function () {
|
||||||
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
const TrackingProps = require('../../lib/file_data/tracking_props')
|
const TrackingProps = require('../../../lib/file_data/tracking_props')
|
||||||
const ClearTrackingProps = require('../../lib/file_data/clear_tracking_props')
|
const ClearTrackingProps = require('../../../lib/file_data/clear_tracking_props')
|
||||||
const TextOperation = require('../../lib/operation/text_operation')
|
const TextOperation = require('../../../lib/operation/text_operation')
|
||||||
const random = require('./random')
|
const random = require('./random')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
+5
-5
@@ -10,12 +10,12 @@ const { expect } = require('chai')
|
|||||||
const random = require('./support/random')
|
const random = require('./support/random')
|
||||||
const randomOperation = require('./support/random_text_operation')
|
const randomOperation = require('./support/random_text_operation')
|
||||||
|
|
||||||
const ot = require('..')
|
const ot = require('../..')
|
||||||
const TextOperation = ot.TextOperation
|
const TextOperation = ot.TextOperation
|
||||||
const StringFileData = require('../lib/file_data/string_file_data')
|
const StringFileData = require('../../lib/file_data/string_file_data')
|
||||||
const { RetainOp, InsertOp, RemoveOp } = require('../lib/operation/scan_op')
|
const { RetainOp, InsertOp, RemoveOp } = require('../../lib/operation/scan_op')
|
||||||
const TrackingProps = require('../lib/file_data/tracking_props')
|
const TrackingProps = require('../../lib/file_data/tracking_props')
|
||||||
const ClearTrackingProps = require('../lib/file_data/clear_tracking_props')
|
const ClearTrackingProps = require('../../lib/file_data/clear_tracking_props')
|
||||||
|
|
||||||
describe('TextOperation', function () {
|
describe('TextOperation', function () {
|
||||||
const numTrials = 500
|
const numTrials = 500
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
const TrackedChange = require('../lib/file_data/tracked_change')
|
const TrackedChange = require('../../lib/file_data/tracked_change')
|
||||||
const Range = require('../lib/range')
|
const Range = require('../../lib/range')
|
||||||
const TrackingProps = require('../lib/file_data/tracking_props')
|
const TrackingProps = require('../../lib/file_data/tracking_props')
|
||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
|
|
||||||
describe('TrackedChange', function () {
|
describe('TrackedChange', function () {
|
||||||
+4
-4
@@ -1,9 +1,9 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
const TrackedChangeList = require('../lib/file_data/tracked_change_list')
|
const TrackedChangeList = require('../../lib/file_data/tracked_change_list')
|
||||||
const TrackingProps = require('../lib/file_data/tracking_props')
|
const TrackingProps = require('../../lib/file_data/tracking_props')
|
||||||
const ClearTrackingProps = require('../lib/file_data/clear_tracking_props')
|
const ClearTrackingProps = require('../../lib/file_data/clear_tracking_props')
|
||||||
const { expect } = require('chai')
|
const { expect } = require('chai')
|
||||||
/** @import { TrackedChangeRawData } from '../lib/types' */
|
/** @import { TrackedChangeRawData } from '../../lib/types' */
|
||||||
|
|
||||||
describe('TrackedChangeList', function () {
|
describe('TrackedChangeList', function () {
|
||||||
describe('applyInsert', function () {
|
describe('applyInsert', function () {
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
// no setup yet
|
||||||
@@ -1 +0,0 @@
|
|||||||
// There are no tests yet
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
// no setup yet
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
// no setup yet
|
||||||
Reference in New Issue
Block a user