From e69b063687e098803b873e62e23bfa7cf763c5d5 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Mon, 5 Jun 2023 00:33:43 +0100 Subject: [PATCH] Porting tests over to vitest --- demo/1-basic.ts | 2 +- demo/10-my-cv.ts | 4 +- demo/11-declaritive-styles-2.ts | 4 +- demo/12-scaling-images.ts | 4 +- demo/13-xml-styles.ts | 4 +- demo/14-page-numbers.ts | 4 +- demo/15-page-break-before.ts | 4 +- demo/16-multiple-sections.ts | 4 +- demo/17-footnotes.ts | 4 +- demo/18-image-from-buffer.ts | 4 +- demo/19-export-to-base64.ts | 4 +- demo/2-declaritive-styles.ts | 2 +- demo/20-table-cell-borders.ts | 4 +- demo/21-bookmarks.ts | 15 +- demo/22-right-to-left-text.ts | 4 +- demo/23-base64-images.ts | 4 +- demo/24-images-to-table-cell.ts | 4 +- demo/25-table-xml-styles.ts | 4 +- demo/26-paragraph-borders.ts | 4 +- demo/27-declaritive-styles-3.ts | 4 +- demo/28-table-of-contents.ts | 4 +- demo/29-numbered-lists.ts | 4 +- demo/3-numbering-and-bullet-points.ts | 4 +- demo/31-tables.ts | 4 +- demo/32-merge-and-shade-table-cells.ts | 4 +- demo/33-sequential-captions.ts | 4 +- demo/34-floating-tables.ts | 4 +- demo/35-hyperlinks.ts | 4 +- demo/36-image-to-table-cell.ts | 4 +- demo/37-images-to-header-and-footer.ts | 4 +- demo/38-text-wrapping.ts | 6 +- demo/39-page-numbers.ts | 4 +- demo/4-basic-table.ts | 4 +- demo/40-line-numbers.ts | 4 +- demo/41-merge-table-cells-2.ts | 4 +- demo/42-restart-page-numbers.ts | 4 +- demo/43-images-to-table-cell-2.ts | 4 +- demo/44-multiple-columns.ts | 4 +- demo/45-highlighting-text.ts | 4 +- demo/46-shading-text.ts | 4 +- demo/47-number-of-total-pages-section.ts | 4 +- demo/48-vertical-align.ts | 4 +- demo/49-table-borders.ts | 4 +- demo/5-images.ts | 4 +- demo/50-readme-demo.ts | 4 +- demo/51-character-styles.ts | 4 +- demo/52-japanese.ts | 4 +- demo/53-chinese.ts | 3 +- demo/54-custom-properties.ts | 3 +- demo/55-math.ts | 4 +- demo/56-background-color.ts | 4 +- demo/57-add-parent-numbered-lists.ts | 4 +- demo/58-section-types.ts | 4 +- demo/59-header-footer-margins.ts | 4 +- demo/6-page-borders.ts | 4 +- demo/60-track-revisions.ts | 4 +- demo/61-text-frame.ts | 2 +- demo/62-paragraph-spacing.ts | 4 +- demo/63-odd-even-header-footer.ts | 4 +- demo/64-complex-numbering-text.ts | 4 +- demo/65-page-sizes.ts | 4 +- demo/66-fields.ts | 4 +- demo/67-column-break.ts | 4 +- ...numbering-instances-and-starting-number.ts | 2 +- demo/69-different-width-columns.ts | 4 +- demo/7-landscape.ts | 4 +- demo/70-line-numbers-suppression.ts | 4 +- demo/71-page-borders-2.ts | 4 +- demo/72-word-wrap.ts | 4 +- demo/73-comments.ts | 4 +- demo/74-nodejs-stream.ts | 2 +- demo/75-tab-stops.ts | 2 +- demo/76-compatibility.ts | 4 +- demo/77-side-by-side-tables.ts | 4 +- demo/78-thai-distributed.ts | 4 +- demo/79-table-from-data-source.ts | 4 +- demo/8-header-footer.ts | 4 +- demo/80-thai-distributed.ts | 4 +- demo/81-continuous-header.ts | 4 +- demo/82-new-headers-new-section.ts | 4 +- demo/83-setting-languages.ts | 4 +- demo/84-positional-tabs.ts | 4 +- demo/85-template-document.ts | 4 +- demo/86-generate-template.ts | 4 +- demo/87-template-document.ts | 4 +- demo/88-template-document.ts | 4 +- demo/89-template-document.ts | 4 +- demo/9-images-in-header-and-footer.ts | 4 +- package-lock.json | 999 +++++++++++++++++- package.json | 4 +- src/export/formatter.spec.ts | 2 +- src/export/packer/image-replacer.spec.ts | 2 +- src/export/packer/next-compiler.spec.ts | 333 +++--- src/export/packer/packer.spec.ts | 105 +- src/export/packer/packer.ts | 13 +- src/file/border/border.spec.ts | 2 +- src/file/content-types/content-types.spec.ts | 2 +- src/file/core-properties/properties.spec.ts | 2 +- .../custom-properties.spec.ts | 2 +- src/file/document-wrapper.spec.ts | 2 +- src/file/document/body/body.spec.ts | 2 +- .../properties/columns.spec.ts | 2 +- .../properties/doc-grid.spec.ts | 2 +- .../header-footer-reference.spec.ts | 2 +- .../properties/page-borders.spec.ts | 2 +- .../properties/page-size.spec.ts | 2 +- .../properties/page-text-direction.spec.ts | 2 +- .../properties/section-type.spec.ts | 2 +- .../section-properties.spec.ts | 2 +- .../document-background.spec.ts | 2 +- src/file/document/document.spec.ts | 2 +- src/file/drawing/anchor/anchor.spec.ts | 2 +- .../doc-properties-children.spec.ts | 2 +- src/file/drawing/drawing.spec.ts | 2 +- src/file/drawing/floating/align.spec.ts | 2 +- .../floating/horizontal-position.spec.ts | 2 +- .../drawing/floating/position-offset.spec.ts | 2 +- src/file/drawing/floating/simple-pos.spec.ts | 2 +- .../floating/vertical-position.spec.ts | 2 +- .../pic/shape-properties/form.spec.ts | 2 +- .../shape-properties/outline/no-fill.spec.ts | 2 +- .../shape-properties/outline/outline.spec.ts | 2 +- src/file/file.spec.ts | 2 +- src/file/footer-wrapper.spec.ts | 2 +- src/file/footer/footer.spec.ts | 2 +- src/file/footnotes-wrapper.spec.ts | 2 +- src/file/footnotes/footnote/footnote.spec.ts | 2 +- src/file/header-wrapper.spec.ts | 2 +- src/file/header/header.spec.ts | 2 +- src/file/media/media.spec.ts | 11 +- src/file/numbering/abstract-numbering.spec.ts | 2 +- src/file/numbering/concrete-numbering.spec.ts | 2 +- src/file/numbering/level.spec.ts | 2 +- src/file/numbering/numbering.spec.ts | 2 +- .../paragraph/formatting/alignment.spec.ts | 2 +- src/file/paragraph/formatting/border.spec.ts | 2 +- src/file/paragraph/formatting/break.spec.ts | 2 +- src/file/paragraph/formatting/indent.spec.ts | 2 +- src/file/paragraph/formatting/spacing.spec.ts | 2 +- src/file/paragraph/formatting/style.spec.ts | 2 +- .../paragraph/formatting/tab-stop.spec.ts | 2 +- .../formatting/unordered-list.spec.ts | 2 +- .../paragraph/formatting/word-wrap.spec.ts | 2 +- .../paragraph/frame/frame-properties.spec.ts | 2 +- src/file/paragraph/links/bookmark.spec.ts | 2 +- src/file/paragraph/links/hyperlink.spec.ts | 2 +- .../paragraph/links/outline-level.spec.ts | 2 +- .../links/pageref-field-instruction.spec.ts | 2 +- src/file/paragraph/links/pageref.spec.ts | 2 +- .../brackets/math-angled-brackets.spec.ts | 2 +- .../brackets/math-beginning-character.spec.ts | 2 +- .../brackets/math-bracket-properties.spec.ts | 2 +- .../math/brackets/math-curly-brackets.spec.ts | 2 +- .../brackets/math-ending-character.spec.ts | 2 +- .../math/brackets/math-round-brackets.spec.ts | 2 +- .../brackets/math-square-brackets.spec.ts | 2 +- .../math/fraction/math-denominator.spec.ts | 2 +- .../math/fraction/math-fraction.spec.ts | 2 +- .../math/fraction/math-numerator.spec.ts | 2 +- .../math/function/math-function-name.spec.ts | 2 +- .../function/math-function-properties.spec.ts | 2 +- .../math/function/math-function.spec.ts | 2 +- src/file/paragraph/math/math-run.spec.ts | 2 +- src/file/paragraph/math/math-text.spec.ts | 2 +- src/file/paragraph/math/math.spec.ts | 2 +- .../math/n-ary/math-accent-character.spec.ts | 2 +- .../paragraph/math/n-ary/math-base.spec.ts | 2 +- .../math/n-ary/math-integral.spec.ts | 2 +- .../math/n-ary/math-limit-location.spec.ts | 2 +- .../math/n-ary/math-n-ary-properties.spec.ts | 2 +- .../math/n-ary/math-sub-script-hide.spec.ts | 2 +- .../math/n-ary/math-sub-script.spec.ts | 2 +- .../paragraph/math/n-ary/math-sum.spec.ts | 2 +- .../math/n-ary/math-super-script-hide.spec.ts | 2 +- .../math/n-ary/math-super-script.spec.ts | 2 +- .../math/radical/math-degree-hide.spec.ts | 2 +- .../math/radical/math-degree.spec.ts | 2 +- .../radical/math-radical-properties.spec.ts | 2 +- .../math/radical/math-radical.spec.ts | 2 +- ...b-super-script-function-properties.spec.ts | 2 +- ...math-pre-sub-super-script-function.spec.ts | 2 +- ...ath-sub-script-function-properties.spec.ts | 2 +- .../math-sub-script-function.spec.ts | 2 +- ...b-super-script-function-properties.spec.ts | 2 +- .../math-sub-super-script-function.spec.ts | 2 +- ...h-super-script-function-properties.spec.ts | 2 +- .../math-super-script-function.spec.ts | 2 +- src/file/paragraph/paragraph.spec.ts | 14 +- src/file/paragraph/properties.spec.ts | 2 +- src/file/paragraph/run/break.spec.ts | 2 +- src/file/paragraph/run/comment-run.spec.ts | 2 +- src/file/paragraph/run/emphasis-mark.spec.ts | 2 +- src/file/paragraph/run/empty-children.spec.ts | 2 +- src/file/paragraph/run/formatting.spec.ts | 2 +- src/file/paragraph/run/image-run.spec.ts | 11 +- src/file/paragraph/run/language.spec.ts | 2 +- src/file/paragraph/run/page-number.spec.ts | 2 +- src/file/paragraph/run/positional-tab.spec.ts | 2 +- .../run/run-components/symbol.spec.ts | 2 +- .../paragraph/run/run-components/text.spec.ts | 2 +- src/file/paragraph/run/run-fonts.spec.ts | 2 +- src/file/paragraph/run/run.spec.ts | 2 +- src/file/paragraph/run/script.spec.ts | 2 +- .../run/sequential-identifier.spec.ts | 2 +- src/file/paragraph/run/simple-field.spec.ts | 2 +- src/file/paragraph/run/symbol-run.spec.ts | 2 +- src/file/paragraph/run/text-run.spec.ts | 2 +- src/file/paragraph/run/underline.spec.ts | 2 +- src/file/relationships/relationships.spec.ts | 2 +- .../compatibility-setting.spec.ts | 2 +- src/file/settings/compatibility.spec.ts | 2 +- src/file/settings/settings.spec.ts | 2 +- src/file/shading/shading.spec.ts | 2 +- .../styles/defaults/document-defaults.spec.ts | 2 +- .../styles/external-styles-factory.spec.ts | 2 +- .../styles/latent-styles/exceptions.spec.ts | 2 +- .../latent-styles/latent-styles.spec.ts | 2 +- src/file/styles/sample/default-style.spec.ts | 2 +- src/file/styles/style/character-style.spec.ts | 2 +- src/file/styles/style/components.spec.ts | 2 +- src/file/styles/style/default-styles.spec.ts | 2 +- src/file/styles/style/paragraph-style.spec.ts | 2 +- src/file/styles/style/style.spec.ts | 2 +- src/file/styles/styles.spec.ts | 2 +- .../table-of-contents.spec.ts | 2 +- src/file/table/grid.spec.ts | 2 +- .../table-cell/table-cell-properties.spec.ts | 2 +- src/file/table/table-cell/table-cell.spec.ts | 2 +- .../table-properties/table-borders.spec.ts | 2 +- .../table-cell-margin.spec.ts | 2 +- .../table-float-properties.spec.ts | 2 +- .../table-properties/table-properties.spec.ts | 2 +- .../table-row/table-row-properties.spec.ts | 2 +- src/file/table/table-row/table-row.spec.ts | 2 +- src/file/table/table.spec.ts | 2 +- .../deleted-page-number.spec.ts | 2 +- .../deleted-text-run.spec.ts | 2 +- .../deleted-text.spec.ts | 2 +- .../inserted-text-run.spec.ts | 2 +- src/file/xml-components/attribute.spec.ts | 2 +- .../imported-xml-component.spec.ts | 2 +- .../xml-components/simple-elements.spec.ts | 2 +- src/file/xml-components/xml-component.spec.ts | 2 +- src/index.spec.ts | 2 +- src/patcher/content-types-manager.spec.ts | 2 +- src/patcher/from-docx.spec.ts | 10 +- src/patcher/paragraph-split-inject.spec.ts | 2 +- src/patcher/paragraph-token-replacer.spec.ts | 2 +- src/patcher/relationship-manager.spec.ts | 2 +- src/patcher/replacer.spec.ts | 2 +- src/patcher/run-renderer.spec.ts | 2 +- src/patcher/traverser.spec.ts | 2 +- src/patcher/util.spec.ts | 2 +- src/util/convenience-functions.spec.ts | 2 +- src/util/values.spec.ts | 2 +- vite.config.ts | 2 +- 256 files changed, 1557 insertions(+), 612 deletions(-) diff --git a/demo/1-basic.ts b/demo/1-basic.ts index 80162360a4..79d774a270 100644 --- a/demo/1-basic.ts +++ b/demo/1-basic.ts @@ -1,5 +1,5 @@ // Simple example to add text to a document -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; import { Document, Packer, Paragraph, Tab, TextRun } from "docx"; diff --git a/demo/10-my-cv.ts b/demo/10-my-cv.ts index ad36f4ef08..5734ebd507 100644 --- a/demo/10-my-cv.ts +++ b/demo/10-my-cv.ts @@ -1,7 +1,7 @@ // Generate a CV -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { AlignmentType, Document, HeadingLevel, Packer, Paragraph, Tab, TabStopPosition, TabStopType, TextRun } from "../build"; +import { AlignmentType, Document, HeadingLevel, Packer, Paragraph, Tab, TabStopPosition, TabStopType, TextRun } from "docx"; // tslint:disable:no-shadowed-variable diff --git a/demo/11-declaritive-styles-2.ts b/demo/11-declaritive-styles-2.ts index 93b4557348..9f7981de21 100644 --- a/demo/11-declaritive-styles-2.ts +++ b/demo/11-declaritive-styles-2.ts @@ -1,5 +1,5 @@ // Setting styles with JavaScript configuration -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; import { AlignmentType, @@ -16,7 +16,7 @@ import { TabStopPosition, UnderlineType, LevelFormat, -} from "../build"; +} from "docx"; const table = new Table({ rows: [ diff --git a/demo/12-scaling-images.ts b/demo/12-scaling-images.ts index bc628018b3..84d92e6b7b 100644 --- a/demo/12-scaling-images.ts +++ b/demo/12-scaling-images.ts @@ -1,7 +1,7 @@ // Scaling images -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, ImageRun, Packer, Paragraph } from "../build"; +import { Document, ImageRun, Packer, Paragraph } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/13-xml-styles.ts b/demo/13-xml-styles.ts index e555b963b5..7d7391219e 100644 --- a/demo/13-xml-styles.ts +++ b/demo/13-xml-styles.ts @@ -1,7 +1,7 @@ // This example shows 3 styles using XML styles -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, HeadingLevel, Packer, Paragraph } from "../build"; +import { Document, HeadingLevel, Packer, Paragraph } from "docx"; const styles = fs.readFileSync("./demo/assets/custom-styles.xml", "utf-8"); const doc = new Document({ diff --git a/demo/14-page-numbers.ts b/demo/14-page-numbers.ts index 9d40b30700..b74db6318f 100644 --- a/demo/14-page-numbers.ts +++ b/demo/14-page-numbers.ts @@ -1,7 +1,7 @@ // Page numbers -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { AlignmentType, Document, Footer, Header, Packer, PageBreak, PageNumber, Paragraph, TextRun } from "../build"; +import { AlignmentType, Document, Footer, Header, Packer, PageBreak, PageNumber, Paragraph, TextRun } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/15-page-break-before.ts b/demo/15-page-break-before.ts index a25f4b0708..4af81ed8dd 100644 --- a/demo/15-page-break-before.ts +++ b/demo/15-page-break-before.ts @@ -1,7 +1,7 @@ // Page break before example -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, Paragraph } from "../build"; +import { Document, Packer, Paragraph } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/16-multiple-sections.ts b/demo/16-multiple-sections.ts index db4bf4aac1..c9a0e2e218 100644 --- a/demo/16-multiple-sections.ts +++ b/demo/16-multiple-sections.ts @@ -1,7 +1,7 @@ // Multiple sections and headers -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Footer, Header, Packer, PageNumber, NumberFormat, PageOrientation, Paragraph, TextRun } from "../build"; +import { Document, Footer, Header, Packer, PageNumber, NumberFormat, PageOrientation, Paragraph, TextRun } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/17-footnotes.ts b/demo/17-footnotes.ts index 459cf2117c..42e03902b4 100644 --- a/demo/17-footnotes.ts +++ b/demo/17-footnotes.ts @@ -1,7 +1,7 @@ // Footnotes -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, FootnoteReferenceRun, Packer, Paragraph, TextRun } from "../build"; +import { Document, FootnoteReferenceRun, Packer, Paragraph, TextRun } from "docx"; const doc = new Document({ footnotes: { diff --git a/demo/18-image-from-buffer.ts b/demo/18-image-from-buffer.ts index 6f41344117..918cc1958c 100644 --- a/demo/18-image-from-buffer.ts +++ b/demo/18-image-from-buffer.ts @@ -1,7 +1,7 @@ // Insert image from a buffer -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, ImageRun, Packer, Paragraph } from "../build"; +import { Document, ImageRun, Packer, Paragraph } from "docx"; const imageBase64Data = `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`; diff --git a/demo/19-export-to-base64.ts b/demo/19-export-to-base64.ts index 3d54e9ee38..669f8f8ca2 100644 --- a/demo/19-export-to-base64.ts +++ b/demo/19-export-to-base64.ts @@ -1,7 +1,7 @@ // Export to base64 string - Useful in a browser environment. -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, Paragraph, Tab, TextRun } from "../build"; +import { Document, Packer, Paragraph, Tab, TextRun } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/2-declaritive-styles.ts b/demo/2-declaritive-styles.ts index dd8d40926a..6426d5bf53 100644 --- a/demo/2-declaritive-styles.ts +++ b/demo/2-declaritive-styles.ts @@ -1,5 +1,5 @@ // Example on how to customize the look at feel using Styles -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; import { AlignmentType, convertInchesToTwip, Document, HeadingLevel, LevelFormat, Packer, Paragraph, TextRun, UnderlineType } from "docx"; diff --git a/demo/20-table-cell-borders.ts b/demo/20-table-cell-borders.ts index 9174fa28fa..3c4543f4c9 100644 --- a/demo/20-table-cell-borders.ts +++ b/demo/20-table-cell-borders.ts @@ -1,7 +1,7 @@ // Add custom borders to table cell -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { BorderStyle, Document, Packer, Paragraph, Table, TableCell, TableRow } from "../build"; +import { BorderStyle, Document, Packer, Paragraph, Table, TableCell, TableRow } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/21-bookmarks.ts b/demo/21-bookmarks.ts index 5ae3a35ec3..f677eb8889 100644 --- a/demo/21-bookmarks.ts +++ b/demo/21-bookmarks.ts @@ -1,18 +1,7 @@ // This demo shows how to create bookmarks then link to them with internal hyperlinks -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { - Bookmark, - Document, - Footer, - HeadingLevel, - InternalHyperlink, - Packer, - PageBreak, - Paragraph, - TextRun, - PageReference, -} from "../build"; +import { Bookmark, Document, Footer, HeadingLevel, InternalHyperlink, Packer, PageBreak, Paragraph, TextRun, PageReference } from "docx"; const LOREM_IPSUM = /* cspell:disable-next-line */ diff --git a/demo/22-right-to-left-text.ts b/demo/22-right-to-left-text.ts index ceb5071fb1..aeb227b4e6 100644 --- a/demo/22-right-to-left-text.ts +++ b/demo/22-right-to-left-text.ts @@ -1,7 +1,7 @@ // This demo shows right to left for special languages -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, Paragraph, Table, TableCell, TableRow, TextRun } from "../build"; +import { Document, Packer, Paragraph, Table, TableCell, TableRow, TextRun } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/23-base64-images.ts b/demo/23-base64-images.ts index 9fbb7f83da..df2e92217c 100644 --- a/demo/23-base64-images.ts +++ b/demo/23-base64-images.ts @@ -1,7 +1,7 @@ // This demo adds an image to the Media cache, and then insert to the document afterwards -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, ImageRun, Packer, Paragraph, TextRun } from "../build"; +import { Document, ImageRun, Packer, Paragraph, TextRun } from "docx"; const imageBase64Data = `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`; diff --git a/demo/24-images-to-table-cell.ts b/demo/24-images-to-table-cell.ts index 375149f4f0..e2187f6240 100644 --- a/demo/24-images-to-table-cell.ts +++ b/demo/24-images-to-table-cell.ts @@ -1,7 +1,7 @@ // Add image to table cell -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, ImageRun, Packer, Paragraph, Table, TableCell, TableRow } from "../build"; +import { Document, ImageRun, Packer, Paragraph, Table, TableCell, TableRow } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/25-table-xml-styles.ts b/demo/25-table-xml-styles.ts index de71438bbf..f9b3631725 100644 --- a/demo/25-table-xml-styles.ts +++ b/demo/25-table-xml-styles.ts @@ -1,7 +1,7 @@ // Example of how you would create a table and add data to it -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, Paragraph, Table, TableCell, TableRow, WidthType } from "../build"; +import { Document, Packer, Paragraph, Table, TableCell, TableRow, WidthType } from "docx"; const styles = fs.readFileSync("./demo/assets/custom-styles.xml", "utf-8"); diff --git a/demo/26-paragraph-borders.ts b/demo/26-paragraph-borders.ts index ec32943e4c..0c11304f3e 100644 --- a/demo/26-paragraph-borders.ts +++ b/demo/26-paragraph-borders.ts @@ -1,7 +1,7 @@ // Creates two paragraphs, one with a border and one without -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { BorderStyle, Document, Packer, Paragraph, TextRun } from "../build"; +import { BorderStyle, Document, Packer, Paragraph, TextRun } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/27-declaritive-styles-3.ts b/demo/27-declaritive-styles-3.ts index a527bdf0a3..54efb14f84 100644 --- a/demo/27-declaritive-styles-3.ts +++ b/demo/27-declaritive-styles-3.ts @@ -1,7 +1,7 @@ // Custom styles using JavaScript configuration -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, convertInchesToTwip, HeadingLevel, Packer, Paragraph, UnderlineType } from "../build"; +import { Document, convertInchesToTwip, HeadingLevel, Packer, Paragraph, UnderlineType } from "docx"; const doc = new Document({ styles: { diff --git a/demo/28-table-of-contents.ts b/demo/28-table-of-contents.ts index aa5abd3986..20339b6e3f 100644 --- a/demo/28-table-of-contents.ts +++ b/demo/28-table-of-contents.ts @@ -1,7 +1,7 @@ // Table of contents -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { File, HeadingLevel, Packer, Paragraph, StyleLevel, TableOfContents } from "../build"; +import { File, HeadingLevel, Packer, Paragraph, StyleLevel, TableOfContents } from "docx"; // WordprocessingML docs for TableOfContents can be found here: // http://officeopenxml.com/WPtableOfContents.php diff --git a/demo/29-numbered-lists.ts b/demo/29-numbered-lists.ts index e16d835c6d..b0fd569364 100644 --- a/demo/29-numbered-lists.ts +++ b/demo/29-numbered-lists.ts @@ -1,8 +1,8 @@ // Numbered lists // The lists can also be restarted by specifying the instance number -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { AlignmentType, convertInchesToTwip, Document, HeadingLevel, LevelFormat, Packer, Paragraph } from "../build"; +import { AlignmentType, convertInchesToTwip, Document, HeadingLevel, LevelFormat, Packer, Paragraph } from "docx"; const doc = new Document({ numbering: { diff --git a/demo/3-numbering-and-bullet-points.ts b/demo/3-numbering-and-bullet-points.ts index 9242fd59fe..67b0ccfa05 100644 --- a/demo/3-numbering-and-bullet-points.ts +++ b/demo/3-numbering-and-bullet-points.ts @@ -1,7 +1,7 @@ // Numbering and bullet points example -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { AlignmentType, convertInchesToTwip, Document, Footer, Header, HeadingLevel, LevelFormat, Packer, Paragraph } from "../build"; +import { AlignmentType, convertInchesToTwip, Document, Footer, Header, HeadingLevel, LevelFormat, Packer, Paragraph } from "docx"; const doc = new Document({ numbering: { diff --git a/demo/31-tables.ts b/demo/31-tables.ts index c544e21651..251cbbc890 100644 --- a/demo/31-tables.ts +++ b/demo/31-tables.ts @@ -1,7 +1,7 @@ // Example of how you would create a table and add data to it -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, HeadingLevel, Packer, Paragraph, Table, TableCell, TableRow, VerticalAlign, TextDirection } from "../build"; +import { Document, HeadingLevel, Packer, Paragraph, Table, TableCell, TableRow, VerticalAlign, TextDirection } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/32-merge-and-shade-table-cells.ts b/demo/32-merge-and-shade-table-cells.ts index a3e2451f12..d43d86e0c9 100644 --- a/demo/32-merge-and-shade-table-cells.ts +++ b/demo/32-merge-and-shade-table-cells.ts @@ -1,6 +1,6 @@ // Example of how you would merge cells together (Rows and Columns) and apply shading // Also includes an example on how to center tables -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; import { AlignmentType, @@ -15,7 +15,7 @@ import { TableCell, TableRow, WidthType, -} from "../build"; +} from "docx"; const table = new Table({ rows: [ diff --git a/demo/33-sequential-captions.ts b/demo/33-sequential-captions.ts index cc9dca79b9..99d9d50b91 100644 --- a/demo/33-sequential-captions.ts +++ b/demo/33-sequential-captions.ts @@ -1,7 +1,7 @@ // Sequential Captions -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, Paragraph, SequentialIdentifier, TextRun } from "../build"; +import { Document, Packer, Paragraph, SequentialIdentifier, TextRun } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/34-floating-tables.ts b/demo/34-floating-tables.ts index 050f5361ff..68ed2ba1f6 100644 --- a/demo/34-floating-tables.ts +++ b/demo/34-floating-tables.ts @@ -1,5 +1,5 @@ // Example of how you would create a table with float positions -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; import { Document, @@ -14,7 +14,7 @@ import { TableLayoutType, TableRow, WidthType, -} from "../build"; +} from "docx"; const table = new Table({ rows: [ diff --git a/demo/35-hyperlinks.ts b/demo/35-hyperlinks.ts index 6039e6f443..5d2609b3e2 100644 --- a/demo/35-hyperlinks.ts +++ b/demo/35-hyperlinks.ts @@ -1,7 +1,7 @@ // Example on how to add hyperlinks to websites -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, ExternalHyperlink, Footer, FootnoteReferenceRun, ImageRun, Packer, Paragraph, TextRun } from "../build"; +import { Document, ExternalHyperlink, Footer, FootnoteReferenceRun, ImageRun, Packer, Paragraph, TextRun } from "docx"; const doc = new Document({ footnotes: { diff --git a/demo/36-image-to-table-cell.ts b/demo/36-image-to-table-cell.ts index 818c91d659..8f2452a3ff 100644 --- a/demo/36-image-to-table-cell.ts +++ b/demo/36-image-to-table-cell.ts @@ -1,7 +1,7 @@ // Add image to table cell in a header and body -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Header, ImageRun, Packer, Paragraph, Table, TableCell, TableRow } from "../build"; +import { Document, Header, ImageRun, Packer, Paragraph, Table, TableCell, TableRow } from "docx"; const table = new Table({ rows: [ diff --git a/demo/37-images-to-header-and-footer.ts b/demo/37-images-to-header-and-footer.ts index 561020938c..dfecb3b61e 100644 --- a/demo/37-images-to-header-and-footer.ts +++ b/demo/37-images-to-header-and-footer.ts @@ -1,7 +1,7 @@ // Add images to header and footer -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Header, ImageRun, Packer, Paragraph } from "../build"; +import { Document, Header, ImageRun, Packer, Paragraph } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/38-text-wrapping.ts b/demo/38-text-wrapping.ts index fb7a34d00f..e726c237ae 100644 --- a/demo/38-text-wrapping.ts +++ b/demo/38-text-wrapping.ts @@ -1,8 +1,8 @@ // Example of how to "wrap" text around an image -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -// import { Document, Packer, Paragraph } from "../build"; -import { Document, ImageRun, Packer, Paragraph, TextWrappingSide, TextWrappingType } from "../build"; +// import { Document, Packer, Paragraph } from "docx"; +import { Document, ImageRun, Packer, Paragraph, TextWrappingSide, TextWrappingType } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/39-page-numbers.ts b/demo/39-page-numbers.ts index 4b526a5a74..b832eba1a4 100644 --- a/demo/39-page-numbers.ts +++ b/demo/39-page-numbers.ts @@ -1,7 +1,7 @@ // Example how to display page numbers -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { AlignmentType, Document, Footer, Header, Packer, PageBreak, PageNumber, NumberFormat, Paragraph, TextRun } from "../build"; +import { AlignmentType, Document, Footer, Header, Packer, PageBreak, PageNumber, NumberFormat, Paragraph, TextRun } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/4-basic-table.ts b/demo/4-basic-table.ts index 00240fc99b..93ef14ce9f 100644 --- a/demo/4-basic-table.ts +++ b/demo/4-basic-table.ts @@ -1,7 +1,7 @@ // Example of how you would create a table and add data to it -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, Paragraph, Table, TableCell, TableRow, WidthType } from "../build"; +import { Document, Packer, Paragraph, Table, TableCell, TableRow, WidthType } from "docx"; const table = new Table({ columnWidths: [3505, 5505], diff --git a/demo/40-line-numbers.ts b/demo/40-line-numbers.ts index f8765874ee..aaa04bd7ec 100644 --- a/demo/40-line-numbers.ts +++ b/demo/40-line-numbers.ts @@ -1,7 +1,7 @@ // Example demonstrating line numbers. -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, HeadingLevel, LineNumberRestartFormat, Packer, Paragraph } from "../build"; +import { Document, HeadingLevel, LineNumberRestartFormat, Packer, Paragraph } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/41-merge-table-cells-2.ts b/demo/41-merge-table-cells-2.ts index 04c00651e6..b40ab2d44c 100644 --- a/demo/41-merge-table-cells-2.ts +++ b/demo/41-merge-table-cells-2.ts @@ -1,7 +1,7 @@ // Multiple cells merging in the same table - Rows and Columns -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, Paragraph, Table, TableCell, TableRow } from "../build"; +import { Document, Packer, Paragraph, Table, TableCell, TableRow } from "docx"; const table = new Table({ rows: [ diff --git a/demo/42-restart-page-numbers.ts b/demo/42-restart-page-numbers.ts index c8b9636e29..9171a61f50 100644 --- a/demo/42-restart-page-numbers.ts +++ b/demo/42-restart-page-numbers.ts @@ -1,7 +1,7 @@ // Page numbers - Start from 0 on a new section -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { AlignmentType, Document, Header, Packer, PageBreak, PageNumber, PageNumberSeparator, Paragraph, TextRun } from "../build"; +import { AlignmentType, Document, Header, Packer, PageBreak, PageNumber, PageNumberSeparator, Paragraph, TextRun } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/43-images-to-table-cell-2.ts b/demo/43-images-to-table-cell-2.ts index fdc1bec6c9..ed3c919dc2 100644 --- a/demo/43-images-to-table-cell-2.ts +++ b/demo/43-images-to-table-cell-2.ts @@ -1,7 +1,7 @@ // Add image to table cell -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, ImageRun, Packer, Paragraph, Table, TableCell, TableRow, WidthType } from "../build"; +import { Document, ImageRun, Packer, Paragraph, Table, TableCell, TableRow, WidthType } from "docx"; const imageBase64Data = `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`; diff --git a/demo/44-multiple-columns.ts b/demo/44-multiple-columns.ts index 13657eaaa4..3429d2d403 100644 --- a/demo/44-multiple-columns.ts +++ b/demo/44-multiple-columns.ts @@ -1,7 +1,7 @@ // Sections with multiple columns -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, Paragraph } from "../build"; +import { Document, Packer, Paragraph } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/45-highlighting-text.ts b/demo/45-highlighting-text.ts index bc48ebb342..493bf33397 100644 --- a/demo/45-highlighting-text.ts +++ b/demo/45-highlighting-text.ts @@ -1,7 +1,7 @@ // Highlighting text -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { AlignmentType, Document, Header, Packer, Paragraph, TextRun } from "../build"; +import { AlignmentType, Document, Header, Packer, Paragraph, TextRun } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/46-shading-text.ts b/demo/46-shading-text.ts index 289691bd25..02ba620e34 100644 --- a/demo/46-shading-text.ts +++ b/demo/46-shading-text.ts @@ -1,7 +1,7 @@ // Shading text -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { AlignmentType, Document, Header, Packer, Paragraph, ShadingType, TextRun } from "../build"; +import { AlignmentType, Document, Header, Packer, Paragraph, ShadingType, TextRun } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/47-number-of-total-pages-section.ts b/demo/47-number-of-total-pages-section.ts index 8d335337e4..f9b435f197 100644 --- a/demo/47-number-of-total-pages-section.ts +++ b/demo/47-number-of-total-pages-section.ts @@ -1,7 +1,7 @@ // Multiple sections with total number of pages in each section -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { AlignmentType, Document, Footer, Header, Packer, PageBreak, PageNumber, NumberFormat, Paragraph, TextRun } from "../build"; +import { AlignmentType, Document, Footer, Header, Packer, PageBreak, PageNumber, NumberFormat, Paragraph, TextRun } from "docx"; const header = new Header({ children: [ diff --git a/demo/48-vertical-align.ts b/demo/48-vertical-align.ts index 6e9aba0438..135c0ee387 100644 --- a/demo/48-vertical-align.ts +++ b/demo/48-vertical-align.ts @@ -1,7 +1,7 @@ // Example of making content of section vertically aligned -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, Paragraph, VerticalAlign, TextRun, Tab } from "../build"; +import { Document, Packer, Paragraph, VerticalAlign, TextRun, Tab } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/49-table-borders.ts b/demo/49-table-borders.ts index cbb1dabe87..d1f3afadcf 100644 --- a/demo/49-table-borders.ts +++ b/demo/49-table-borders.ts @@ -1,5 +1,5 @@ // Add custom borders and no-borders to the table itself -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; import { BorderStyle, @@ -13,7 +13,7 @@ import { TableRow, TextDirection, VerticalAlign, -} from "../build"; +} from "docx"; const table = new Table({ rows: [ diff --git a/demo/5-images.ts b/demo/5-images.ts index e6496266fe..a0b05de3e8 100644 --- a/demo/5-images.ts +++ b/demo/5-images.ts @@ -1,5 +1,5 @@ // Example of how to add images to the document - You can use Buffers, UInt8Arrays or Base64 strings -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; import { Document, @@ -10,7 +10,7 @@ import { Paragraph, VerticalPositionAlign, VerticalPositionRelativeFrom, -} from "../build"; +} from "docx"; const doc = new Document({ sections: [ diff --git a/demo/50-readme-demo.ts b/demo/50-readme-demo.ts index 440a230a4f..5330d09618 100644 --- a/demo/50-readme-demo.ts +++ b/demo/50-readme-demo.ts @@ -1,7 +1,7 @@ // The demo on the README.md -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, HeadingLevel, ImageRun, Packer, Paragraph, Table, TableCell, TableRow, VerticalAlign } from "../build"; +import { Document, HeadingLevel, ImageRun, Packer, Paragraph, Table, TableCell, TableRow, VerticalAlign } from "docx"; const table = new Table({ rows: [ diff --git a/demo/51-character-styles.ts b/demo/51-character-styles.ts index 6300920808..6bc79f0660 100644 --- a/demo/51-character-styles.ts +++ b/demo/51-character-styles.ts @@ -1,7 +1,7 @@ // Custom character styles using JavaScript configuration -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, Paragraph, TextRun } from "../build"; +import { Document, Packer, Paragraph, TextRun } from "docx"; const doc = new Document({ styles: { diff --git a/demo/52-japanese.ts b/demo/52-japanese.ts index 4bbf5225bd..3c0eba87cf 100644 --- a/demo/52-japanese.ts +++ b/demo/52-japanese.ts @@ -1,7 +1,7 @@ // Japanese text - Need to use a Japanese font -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, HeadingLevel, Packer, Paragraph } from "../build"; +import { Document, HeadingLevel, Packer, Paragraph } from "docx"; const doc = new Document({ styles: { diff --git a/demo/53-chinese.ts b/demo/53-chinese.ts index f32feab14d..dbf50c88e8 100644 --- a/demo/53-chinese.ts +++ b/demo/53-chinese.ts @@ -5,9 +5,8 @@ // Note that if the OS have not install `KaiTi` font, this demo doesn't work. -// Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, HeadingLevel, Packer, Paragraph, TextRun } from "../build"; +import { Document, HeadingLevel, Packer, Paragraph, TextRun } from "docx"; const doc = new Document({ styles: { diff --git a/demo/54-custom-properties.ts b/demo/54-custom-properties.ts index 8a217183a0..f1ce4b330d 100644 --- a/demo/54-custom-properties.ts +++ b/demo/54-custom-properties.ts @@ -3,9 +3,8 @@ // to the document in Word after the document has been generated. Standard properties (such as creator, title // and subject) cover typical use cases, but sometimes custom properties are required. -// Import from 'docx' rather than '../build' if you install from npm import * as fs from "fs"; -import { Document, Packer } from "../build"; +import { Document, Packer } from "docx"; const doc = new Document( // Standard properties diff --git a/demo/55-math.ts b/demo/55-math.ts index 887921900a..607071ec52 100644 --- a/demo/55-math.ts +++ b/demo/55-math.ts @@ -1,5 +1,5 @@ // Simple example to add text to a document -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; import { Document, @@ -21,7 +21,7 @@ import { Packer, Paragraph, TextRun, -} from "../build"; +} from "docx"; const doc = new Document({ sections: [ diff --git a/demo/56-background-color.ts b/demo/56-background-color.ts index 3f290f6170..be5db1a2b6 100644 --- a/demo/56-background-color.ts +++ b/demo/56-background-color.ts @@ -1,7 +1,7 @@ // Change background colour of whole document -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, Paragraph, Tab, TextRun } from "../build"; +import { Document, Packer, Paragraph, Tab, TextRun } from "docx"; const doc = new Document({ background: { diff --git a/demo/57-add-parent-numbered-lists.ts b/demo/57-add-parent-numbered-lists.ts index 4287de886e..094faa2eb4 100644 --- a/demo/57-add-parent-numbered-lists.ts +++ b/demo/57-add-parent-numbered-lists.ts @@ -1,7 +1,7 @@ // Numbered lists - Add parent number in sub number -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { AlignmentType, convertInchesToTwip, Document, HeadingLevel, LevelFormat, Packer, Paragraph } from "../build"; +import { AlignmentType, convertInchesToTwip, Document, HeadingLevel, LevelFormat, Packer, Paragraph } from "docx"; const doc = new Document({ numbering: { diff --git a/demo/58-section-types.ts b/demo/58-section-types.ts index 011ec9a0b8..2498828e9d 100644 --- a/demo/58-section-types.ts +++ b/demo/58-section-types.ts @@ -1,7 +1,7 @@ // Usage of different Section Types -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, Paragraph, TextRun, SectionType } from "../build"; +import { Document, Packer, Paragraph, TextRun, SectionType } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/59-header-footer-margins.ts b/demo/59-header-footer-margins.ts index f03e89e3a3..135005602d 100644 --- a/demo/59-header-footer-margins.ts +++ b/demo/59-header-footer-margins.ts @@ -1,7 +1,7 @@ // Move + offset header and footer -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Footer, Header, Packer, Paragraph } from "../build"; +import { Document, Footer, Header, Packer, Paragraph } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/6-page-borders.ts b/demo/6-page-borders.ts index 79758e88e8..ff870bc384 100644 --- a/demo/6-page-borders.ts +++ b/demo/6-page-borders.ts @@ -1,7 +1,7 @@ // Example of how to change page borders -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, HeadingLevel, Packer, Paragraph, Tab, TextRun } from "../build"; +import { Document, HeadingLevel, Packer, Paragraph, Tab, TextRun } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/60-track-revisions.ts b/demo/60-track-revisions.ts index d6b2e3a36c..ce7e8ed66f 100644 --- a/demo/60-track-revisions.ts +++ b/demo/60-track-revisions.ts @@ -1,5 +1,5 @@ // Track Revisions aka. "Track Changes" -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; import { AlignmentType, @@ -14,7 +14,7 @@ import { ShadingType, Tab, TextRun, -} from "../build"; +} from "docx"; /* For reference, see diff --git a/demo/61-text-frame.ts b/demo/61-text-frame.ts index bc58a2087f..a9460bae87 100644 --- a/demo/61-text-frame.ts +++ b/demo/61-text-frame.ts @@ -1,5 +1,5 @@ // Text Frame (Text Box) example -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; import { BorderStyle, diff --git a/demo/62-paragraph-spacing.ts b/demo/62-paragraph-spacing.ts index 9d17a1be30..f46f48568f 100644 --- a/demo/62-paragraph-spacing.ts +++ b/demo/62-paragraph-spacing.ts @@ -1,7 +1,7 @@ // Simple example to add text to a document -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, LineRuleType, Packer, Paragraph, TextRun } from "../build"; +import { Document, LineRuleType, Packer, Paragraph, TextRun } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/63-odd-even-header-footer.ts b/demo/63-odd-even-header-footer.ts index c2e7723922..4e579a7f04 100644 --- a/demo/63-odd-even-header-footer.ts +++ b/demo/63-odd-even-header-footer.ts @@ -1,7 +1,7 @@ // Move + offset header and footer -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Footer, Header, Packer, PageBreak, Paragraph, TextRun } from "../build"; +import { Document, Footer, Header, Packer, PageBreak, Paragraph, TextRun } from "docx"; const doc = new Document({ evenAndOddHeaderAndFooters: true, diff --git a/demo/64-complex-numbering-text.ts b/demo/64-complex-numbering-text.ts index 84d0f70ad7..2eb62c45eb 100644 --- a/demo/64-complex-numbering-text.ts +++ b/demo/64-complex-numbering-text.ts @@ -1,7 +1,7 @@ // Numbered lists - With complex number text -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, Paragraph, LevelFormat } from "../build"; +import { Document, Packer, Paragraph, LevelFormat } from "docx"; const doc = new Document({ numbering: { diff --git a/demo/65-page-sizes.ts b/demo/65-page-sizes.ts index d6a9480c44..df5dd84db1 100644 --- a/demo/65-page-sizes.ts +++ b/demo/65-page-sizes.ts @@ -1,8 +1,8 @@ // Example of how to set the document page sizes // Reference from https://papersizes.io/a/a3 -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { convertMillimetersToTwip, Document, Packer, PageOrientation, Paragraph } from "../build"; +import { convertMillimetersToTwip, Document, Packer, PageOrientation, Paragraph } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/66-fields.ts b/demo/66-fields.ts index 64c1acf5e7..781d239fc9 100644 --- a/demo/66-fields.ts +++ b/demo/66-fields.ts @@ -1,7 +1,7 @@ // Use fields to include dynamic text -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Bookmark, Document, Packer, Paragraph, SimpleField, TextRun } from "../build"; +import { Bookmark, Document, Packer, Paragraph, SimpleField, TextRun } from "docx"; const doc = new Document({ creator: "Me", diff --git a/demo/67-column-break.ts b/demo/67-column-break.ts index 2746bffefd..52e8773a8e 100644 --- a/demo/67-column-break.ts +++ b/demo/67-column-break.ts @@ -1,7 +1,7 @@ // Section with 2 columns including a column break -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, Paragraph, ColumnBreak, TextRun } from "../build"; +import { Document, Packer, Paragraph, ColumnBreak, TextRun } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/68-numbering-instances-and-starting-number.ts b/demo/68-numbering-instances-and-starting-number.ts index ac4975ba22..1a7ca335f7 100644 --- a/demo/68-numbering-instances-and-starting-number.ts +++ b/demo/68-numbering-instances-and-starting-number.ts @@ -1,5 +1,5 @@ import * as fs from "fs"; -import { Document, Packer, Paragraph, LevelFormat } from "../build"; +import { Document, Packer, Paragraph, LevelFormat } from "docx"; const doc = new Document({ numbering: { diff --git a/demo/69-different-width-columns.ts b/demo/69-different-width-columns.ts index 883391c195..3b40eb5d00 100644 --- a/demo/69-different-width-columns.ts +++ b/demo/69-different-width-columns.ts @@ -1,7 +1,7 @@ // Sections with multiple columns -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Column, Document, Packer, Paragraph } from "../build"; +import { Column, Document, Packer, Paragraph } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/7-landscape.ts b/demo/7-landscape.ts index 253b4eec5d..4d2c90e107 100644 --- a/demo/7-landscape.ts +++ b/demo/7-landscape.ts @@ -1,7 +1,7 @@ // Example of how to set the document to landscape -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, PageOrientation, Paragraph } from "../build"; +import { Document, Packer, PageOrientation, Paragraph } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/70-line-numbers-suppression.ts b/demo/70-line-numbers-suppression.ts index 4a9b432ef8..cf42017f3d 100644 --- a/demo/70-line-numbers-suppression.ts +++ b/demo/70-line-numbers-suppression.ts @@ -1,7 +1,7 @@ // Example demonstrating line numbers with suppression. -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, HeadingLevel, LineNumberRestartFormat, Packer, Paragraph } from "../build"; +import { Document, HeadingLevel, LineNumberRestartFormat, Packer, Paragraph } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/71-page-borders-2.ts b/demo/71-page-borders-2.ts index f156e25b3a..de03c7f875 100644 --- a/demo/71-page-borders-2.ts +++ b/demo/71-page-borders-2.ts @@ -1,7 +1,7 @@ // Example demonstrating page borders with style, colors and size -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, TextRun, Paragraph, BorderStyle, PageBorderDisplay, PageBorderOffsetFrom, PageBorderZOrder } from "../build"; +import { Document, Packer, TextRun, Paragraph, BorderStyle, PageBorderDisplay, PageBorderOffsetFrom, PageBorderZOrder } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/72-word-wrap.ts b/demo/72-word-wrap.ts index 74c4b2bebe..34cbcd0b56 100644 --- a/demo/72-word-wrap.ts +++ b/demo/72-word-wrap.ts @@ -1,7 +1,7 @@ // Example on how to preserve word wrap text. Works with all languages. -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, Paragraph, TextRun, SpaceType } from "../build"; +import { Document, Packer, Paragraph, TextRun, SpaceType } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/73-comments.ts b/demo/73-comments.ts index deaf1924c1..54fc4def41 100644 --- a/demo/73-comments.ts +++ b/demo/73-comments.ts @@ -1,7 +1,7 @@ // Simple example to add comments to a document -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, Paragraph, TextRun, CommentRangeStart, CommentRangeEnd, CommentReference } from "../build"; +import { Document, Packer, Paragraph, TextRun, CommentRangeStart, CommentRangeEnd, CommentReference } from "docx"; const doc = new Document({ comments: { diff --git a/demo/74-nodejs-stream.ts b/demo/74-nodejs-stream.ts index 3af45d3dd0..a9cc3dd5dd 100644 --- a/demo/74-nodejs-stream.ts +++ b/demo/74-nodejs-stream.ts @@ -1,5 +1,5 @@ // Exporting the document as a stream -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; import { Document, Packer, Paragraph, Tab, TextRun } from "docx"; diff --git a/demo/75-tab-stops.ts b/demo/75-tab-stops.ts index 42b7c4dae5..4f8768a6c8 100644 --- a/demo/75-tab-stops.ts +++ b/demo/75-tab-stops.ts @@ -1,5 +1,5 @@ // Example of using tab stops -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; import { Document, HeadingLevel, Packer, Paragraph, TabStopPosition, TabStopType, TextRun } from "docx"; diff --git a/demo/76-compatibility.ts b/demo/76-compatibility.ts index 69916ba484..2f114b43a2 100644 --- a/demo/76-compatibility.ts +++ b/demo/76-compatibility.ts @@ -1,7 +1,7 @@ // Add compatibility options -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, Paragraph, TextRun } from "../build"; +import { Document, Packer, Paragraph, TextRun } from "docx"; const doc = new Document({ compatibility: { diff --git a/demo/77-side-by-side-tables.ts b/demo/77-side-by-side-tables.ts index 64b4bfd854..2152d2bd47 100644 --- a/demo/77-side-by-side-tables.ts +++ b/demo/77-side-by-side-tables.ts @@ -1,7 +1,7 @@ // Exporting the document as a stream -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, Paragraph, Table, TableBorders, TableCell, TableRow, WidthType } from "../build"; +import { Document, Packer, Paragraph, Table, TableBorders, TableCell, TableRow, WidthType } from "docx"; const table1 = new Table({ columnWidths: [3505, 5505], diff --git a/demo/78-thai-distributed.ts b/demo/78-thai-distributed.ts index d5ffc13935..f22a9ea5ed 100644 --- a/demo/78-thai-distributed.ts +++ b/demo/78-thai-distributed.ts @@ -1,7 +1,7 @@ // Simple example to add text to a document -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { AlignmentType, Document, Packer, Paragraph, TextRun } from "../build"; +import { AlignmentType, Document, Packer, Paragraph, TextRun } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/79-table-from-data-source.ts b/demo/79-table-from-data-source.ts index bda62e65cd..d2ac3f690c 100644 --- a/demo/79-table-from-data-source.ts +++ b/demo/79-table-from-data-source.ts @@ -1,5 +1,5 @@ // Example of how you would create a table and add data to it from a data source -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; import { Document, @@ -13,7 +13,7 @@ import { TextDirection, TextRun, WidthType, -} from "../build"; +} from "docx"; interface StockPrice { readonly date: Date; diff --git a/demo/8-header-footer.ts b/demo/8-header-footer.ts index a546aa9754..8d0b76d540 100644 --- a/demo/8-header-footer.ts +++ b/demo/8-header-footer.ts @@ -1,7 +1,7 @@ // Add text to header and footer -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Footer, Header, Packer, Paragraph } from "../build"; +import { Document, Footer, Header, Packer, Paragraph } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/80-thai-distributed.ts b/demo/80-thai-distributed.ts index becbd478fe..9f7138ba46 100644 --- a/demo/80-thai-distributed.ts +++ b/demo/80-thai-distributed.ts @@ -1,7 +1,7 @@ // Simple example to add text to a document -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { AlignmentType, convertMillimetersToTwip, Document, Packer, Paragraph, TextRun } from "../build"; +import { AlignmentType, convertMillimetersToTwip, Document, Packer, Paragraph, TextRun } from "docx"; const doc = new Document({ styles: { diff --git a/demo/81-continuous-header.ts b/demo/81-continuous-header.ts index 78ee89eb3a..9c24f64c7a 100644 --- a/demo/81-continuous-header.ts +++ b/demo/81-continuous-header.ts @@ -1,7 +1,7 @@ // Example of a continuous header -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Footer, Header, Packer, Paragraph, SectionType, Tab, TextRun } from "../build"; +import { Document, Footer, Header, Packer, Paragraph, SectionType, Tab, TextRun } from "docx"; const doc = new Document({ creator: "Creator", diff --git a/demo/82-new-headers-new-section.ts b/demo/82-new-headers-new-section.ts index c6a909c672..35c0f6c8b2 100644 --- a/demo/82-new-headers-new-section.ts +++ b/demo/82-new-headers-new-section.ts @@ -1,7 +1,7 @@ // Example of using headers and footers in a new section -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Footer, Header, Packer, Paragraph, SectionType, Tab, TextRun } from "../build"; +import { Document, Footer, Header, Packer, Paragraph, SectionType, Tab, TextRun } from "docx"; const doc = new Document({ creator: "Creator", diff --git a/demo/83-setting-languages.ts b/demo/83-setting-languages.ts index f21d4805da..a5c00ed2e7 100644 --- a/demo/83-setting-languages.ts +++ b/demo/83-setting-languages.ts @@ -1,7 +1,7 @@ // Simple example to add text to a document -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, Paragraph } from "../build"; +import { Document, Packer, Paragraph } from "docx"; const doc = new Document({ styles: { diff --git a/demo/84-positional-tabs.ts b/demo/84-positional-tabs.ts index 1d61b93de7..c138e4c917 100644 --- a/demo/84-positional-tabs.ts +++ b/demo/84-positional-tabs.ts @@ -1,5 +1,5 @@ // Simple example apply positional tabs to a document -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; import { Document, @@ -11,7 +11,7 @@ import { PositionalTabAlignment, PositionalTabRelativeTo, PositionalTabLeader, -} from "../build"; +} from "docx"; const doc = new Document({ sections: [ diff --git a/demo/85-template-document.ts b/demo/85-template-document.ts index 6e41fa1a43..0b509ecaee 100644 --- a/demo/85-template-document.ts +++ b/demo/85-template-document.ts @@ -1,5 +1,5 @@ // Patch a document with patches -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; import { ExternalHyperlink, @@ -14,7 +14,7 @@ import { TextDirection, TextRun, VerticalAlign, -} from "../build"; +} from "docx"; patchDocument(fs.readFileSync("demo/assets/simple-template.docx"), { patches: { diff --git a/demo/86-generate-template.ts b/demo/86-generate-template.ts index e16060f6a6..78854b0a4a 100644 --- a/demo/86-generate-template.ts +++ b/demo/86-generate-template.ts @@ -1,7 +1,7 @@ // Generate a template document -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Packer, Paragraph, TextRun } from "../build"; +import { Document, Packer, Paragraph, TextRun } from "docx"; const doc = new Document({ sections: [ diff --git a/demo/87-template-document.ts b/demo/87-template-document.ts index f1f595b2aa..0dd2c1761d 100644 --- a/demo/87-template-document.ts +++ b/demo/87-template-document.ts @@ -1,7 +1,7 @@ // Patch a document with patches -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { patchDocument, PatchType, TextRun } from "../build"; +import { patchDocument, PatchType, TextRun } from "docx"; patchDocument(fs.readFileSync("demo/assets/simple-template-2.docx"), { patches: { diff --git a/demo/88-template-document.ts b/demo/88-template-document.ts index d380aab4f7..705a5c6f30 100644 --- a/demo/88-template-document.ts +++ b/demo/88-template-document.ts @@ -1,7 +1,7 @@ // Patch a document with patches -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { IPatch, patchDocument, PatchType, TextRun } from "../build"; +import { IPatch, patchDocument, PatchType, TextRun } from "docx"; export const font = "Trebuchet MS"; export const getPatches = (fields: { [key: string]: string }) => { diff --git a/demo/89-template-document.ts b/demo/89-template-document.ts index 547c77404d..3b958c7864 100644 --- a/demo/89-template-document.ts +++ b/demo/89-template-document.ts @@ -1,7 +1,7 @@ // Patch a document with patches -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { IPatch, patchDocument, PatchType, TextRun } from "../build"; +import { IPatch, patchDocument, PatchType, TextRun } from "docx"; export const font = "Trebuchet MS"; export const getPatches = (fields: { [key: string]: string }) => { diff --git a/demo/9-images-in-header-and-footer.ts b/demo/9-images-in-header-and-footer.ts index c435d38060..705ae57eb4 100644 --- a/demo/9-images-in-header-and-footer.ts +++ b/demo/9-images-in-header-and-footer.ts @@ -1,7 +1,7 @@ // Add images to header and footer -// Import from 'docx' rather than '../build' if you install from npm + import * as fs from "fs"; -import { Document, Footer, Header, ImageRun, Packer, Paragraph } from "../build"; +import { Document, Footer, Header, ImageRun, Packer, Paragraph } from "docx"; const doc = new Document({ sections: [ diff --git a/package-lock.json b/package-lock.json index 2b05e26f7e..63019b07e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -67,6 +67,7 @@ "vite-plugin-dts": "^2.3.0", "vite-plugin-node-polyfills": "^0.8.2", "vite-tsconfig-paths": "^4.2.0", + "vitest": "^0.31.4", "webpack": "^5.28.0", "webpack-cli": "^5.0.0" }, @@ -1931,9 +1932,9 @@ "dev": true }, "node_modules/@types/chai": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.4.tgz", - "integrity": "sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==", + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.5.tgz", + "integrity": "sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==", "dev": true }, "node_modules/@types/chai-as-promised": { @@ -1945,6 +1946,15 @@ "@types/chai": "*" } }, + "node_modules/@types/chai-subset": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.3.tgz", + "integrity": "sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==", + "dev": true, + "dependencies": { + "@types/chai": "*" + } + }, "node_modules/@types/color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", @@ -2753,6 +2763,114 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@vitest/expect": { + "version": "0.31.4", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.31.4.tgz", + "integrity": "sha512-tibyx8o7GUyGHZGyPgzwiaPaLDQ9MMuCOrc03BYT0nryUuhLbL7NV2r/q98iv5STlwMgaKuFJkgBW/8iPKwlSg==", + "dev": true, + "dependencies": { + "@vitest/spy": "0.31.4", + "@vitest/utils": "0.31.4", + "chai": "^4.3.7" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "0.31.4", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.31.4.tgz", + "integrity": "sha512-Wgm6UER+gwq6zkyrm5/wbpXGF+g+UBB78asJlFkIOwyse0pz8lZoiC6SW5i4gPnls/zUcPLWS7Zog0LVepXnpg==", + "dev": true, + "dependencies": { + "@vitest/utils": "0.31.4", + "concordance": "^5.0.4", + "p-limit": "^4.0.0", + "pathe": "^1.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@vitest/runner/node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@vitest/snapshot": { + "version": "0.31.4", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.31.4.tgz", + "integrity": "sha512-LemvNumL3NdWSmfVAMpXILGyaXPkZbG5tyl6+RQSdcHnTj6hvA49UAI8jzez9oQyE/FWLKRSNqTGzsHuk89LRA==", + "dev": true, + "dependencies": { + "magic-string": "^0.30.0", + "pathe": "^1.1.0", + "pretty-format": "^27.5.1" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot/node_modules/magic-string": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.0.tgz", + "integrity": "sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.13" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@vitest/spy": { + "version": "0.31.4", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.31.4.tgz", + "integrity": "sha512-3ei5ZH1s3aqbEyftPAzSuunGICRuhE+IXOmpURFdkm5ybUADk+viyQfejNk6q8M5QGX8/EVKw+QWMEP3DTJDag==", + "dev": true, + "dependencies": { + "tinyspy": "^2.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "0.31.4", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.31.4.tgz", + "integrity": "sha512-DobZbHacWznoGUfYU8XDPY78UubJxXfMNY1+SUdOp1NsI34eopSA6aZMeaGu10waSOeYwE8lxrd/pLfT0RMxjQ==", + "dev": true, + "dependencies": { + "concordance": "^5.0.4", + "loupe": "^2.3.6", + "pretty-format": "^27.5.1" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, "node_modules/@webassemblyjs/ast": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", @@ -2956,9 +3074,9 @@ "dev": true }, "node_modules/acorn": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", - "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -3361,6 +3479,12 @@ "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", "dev": true }, + "node_modules/blueimp-md5": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz", + "integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==", + "dev": true + }, "node_modules/bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", @@ -3695,6 +3819,15 @@ "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==", "dev": true }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/cacheable-request": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", @@ -4141,6 +4274,58 @@ "typedarray": "^0.0.6" } }, + "node_modules/concordance": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/concordance/-/concordance-5.0.4.tgz", + "integrity": "sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==", + "dev": true, + "dependencies": { + "date-time": "^3.1.0", + "esutils": "^2.0.3", + "fast-diff": "^1.2.0", + "js-string-escape": "^1.0.1", + "lodash": "^4.17.15", + "md5-hex": "^3.0.1", + "semver": "^7.3.2", + "well-known-symbols": "^2.0.0" + }, + "engines": { + "node": ">=10.18.0 <11 || >=12.14.0 <13 || >=14" + } + }, + "node_modules/concordance/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/concordance/node_modules/semver": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/concordance/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/configstore": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", @@ -4655,6 +4840,18 @@ "node": ">=0.10" } }, + "node_modules/date-time": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/date-time/-/date-time-3.1.0.tgz", + "integrity": "sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==", + "dev": true, + "dependencies": { + "time-zone": "^1.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -6371,6 +6568,12 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true + }, "node_modules/fast-equals": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-4.0.3.tgz", @@ -8403,6 +8606,15 @@ "integrity": "sha512-Y2/yD55y5jteOAmY50JbUZYwk3CP3wnLPEZnlR1w9oKhITrBEtAxwuWKebFf8hMrPMgbYwFoWK/lH2sBkErELw==", "dev": true }, + "node_modules/js-string-escape": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", + "integrity": "sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/js-yaml": { "version": "3.13.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", @@ -8642,6 +8854,18 @@ "node": ">=6.11.5" } }, + "node_modules/local-pkg": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz", + "integrity": "sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -8771,9 +8995,9 @@ } }, "node_modules/loupe": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz", - "integrity": "sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", + "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", "dev": true, "dependencies": { "get-func-name": "^2.0.0" @@ -8858,6 +9082,18 @@ "node": ">= 12" } }, + "node_modules/md5-hex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-3.0.1.tgz", + "integrity": "sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==", + "dev": true, + "dependencies": { + "blueimp-md5": "^2.10.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -9036,6 +9272,18 @@ "mkdirp": "bin/cmd.js" } }, + "node_modules/mlly": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.3.0.tgz", + "integrity": "sha512-HT5mcgIQKkOrZecOjOX3DJorTikWXwsBfpcr/MGBkhfWcjiqvnaL/9ppxvIUXfjT6xt4DVIAsN9fMUz1ev4bIw==", + "dev": true, + "dependencies": { + "acorn": "^8.8.2", + "pathe": "^1.1.0", + "pkg-types": "^1.0.3", + "ufo": "^1.1.2" + } + }, "node_modules/mocha": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", @@ -10190,6 +10438,12 @@ "node": ">=8" } }, + "node_modules/pathe": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.1.tgz", + "integrity": "sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==", + "dev": true + }, "node_modules/pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", @@ -10264,6 +10518,17 @@ "node": ">=8" } }, + "node_modules/pkg-types": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", + "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", + "dev": true, + "dependencies": { + "jsonc-parser": "^3.2.0", + "mlly": "^1.2.0", + "pathe": "^1.1.0" + } + }, "node_modules/pluralize": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", @@ -10346,6 +10611,41 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/pretty-format": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/prismjs": { "version": "1.27.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.27.0.tgz", @@ -10552,6 +10852,12 @@ "rc": "cli.js" } }, + "node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true + }, "node_modules/read": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", @@ -11369,6 +11675,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true + }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", @@ -11619,6 +11931,12 @@ "node": "*" } }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true + }, "node_modules/statuses": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", @@ -11628,6 +11946,12 @@ "node": ">= 0.6" } }, + "node_modules/std-env": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.3.3.tgz", + "integrity": "sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg==", + "dev": true + }, "node_modules/stealthy-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", @@ -11837,6 +12161,18 @@ "node": ">=0.10.0" } }, + "node_modules/strip-literal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.0.1.tgz", + "integrity": "sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q==", + "dev": true, + "dependencies": { + "acorn": "^8.8.2" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -11980,6 +12316,15 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, + "node_modules/time-zone": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz", + "integrity": "sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/timers-browserify": { "version": "2.0.12", "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", @@ -11992,6 +12337,12 @@ "node": ">=0.6.0" } }, + "node_modules/tinybench": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.5.0.tgz", + "integrity": "sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA==", + "dev": true + }, "node_modules/tinydate": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/tinydate/-/tinydate-1.3.0.tgz", @@ -12001,6 +12352,24 @@ "node": ">=4" } }, + "node_modules/tinypool": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.5.0.tgz", + "integrity": "sha512-paHQtnrlS1QZYKF/GnLoOM/DN9fqaGOFbCbxzAhwniySnzl9Ebk8w73/dd34DAhe/obUbPAOldTyYXQZxnPBPQ==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.1.1.tgz", + "integrity": "sha512-XPJL2uSzcOyBMky6OFrusqWlzfFrXtE0hPuMgW8A2HmaqrPo4ZQHRN/V0QXN3FSjKxpsbRrFc5LI7KOwBsT1/w==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/to-readable-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", @@ -12535,6 +12904,12 @@ "node": ">=12.20" } }, + "node_modules/ufo": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.1.2.tgz", + "integrity": "sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==", + "dev": true + }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", @@ -12860,6 +13235,52 @@ } } }, + "node_modules/vite-node": { + "version": "0.31.4", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.31.4.tgz", + "integrity": "sha512-uzL377GjJtTbuc5KQxVbDu2xfU/x0wVjUtXQR2ihS21q/NK6ROr4oG0rsSkBBddZUVCwzfx22in76/0ZZHXgkQ==", + "dev": true, + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.4", + "mlly": "^1.2.0", + "pathe": "^1.1.0", + "picocolors": "^1.0.0", + "vite": "^3.0.0 || ^4.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": ">=v14.18.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vite-node/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/vite-node/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, "node_modules/vite-plugin-dts": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/vite-plugin-dts/-/vite-plugin-dts-2.3.0.tgz", @@ -13000,6 +13421,119 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "node_modules/vitest": { + "version": "0.31.4", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.31.4.tgz", + "integrity": "sha512-GoV0VQPmWrUFOZSg3RpQAPN+LPmHg2/gxlMNJlyxJihkz6qReHDV6b0pPDcqFLNEPya4tWJ1pgwUNP9MLmUfvQ==", + "dev": true, + "dependencies": { + "@types/chai": "^4.3.5", + "@types/chai-subset": "^1.3.3", + "@types/node": "*", + "@vitest/expect": "0.31.4", + "@vitest/runner": "0.31.4", + "@vitest/snapshot": "0.31.4", + "@vitest/spy": "0.31.4", + "@vitest/utils": "0.31.4", + "acorn": "^8.8.2", + "acorn-walk": "^8.2.0", + "cac": "^6.7.14", + "chai": "^4.3.7", + "concordance": "^5.0.4", + "debug": "^4.3.4", + "local-pkg": "^0.4.3", + "magic-string": "^0.30.0", + "pathe": "^1.1.0", + "picocolors": "^1.0.0", + "std-env": "^3.3.2", + "strip-literal": "^1.0.1", + "tinybench": "^2.5.0", + "tinypool": "^0.5.0", + "vite": "^3.0.0 || ^4.0.0", + "vite-node": "0.31.4", + "why-is-node-running": "^2.2.2" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": ">=v14.18.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@vitest/browser": "*", + "@vitest/ui": "*", + "happy-dom": "*", + "jsdom": "*", + "playwright": "*", + "safaridriver": "*", + "webdriverio": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "playwright": { + "optional": true + }, + "safaridriver": { + "optional": true + }, + "webdriverio": { + "optional": true + } + } + }, + "node_modules/vitest/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/vitest/node_modules/magic-string": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.0.tgz", + "integrity": "sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.13" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/vitest/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, "node_modules/vm-browserify": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", @@ -13234,6 +13768,15 @@ "node": ">=10.13.0" } }, + "node_modules/well-known-symbols": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-2.0.0.tgz", + "integrity": "sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", @@ -13298,6 +13841,22 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/why-is-node-running": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", + "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "dev": true, + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", @@ -15125,9 +15684,9 @@ "dev": true }, "@types/chai": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.4.tgz", - "integrity": "sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==", + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.5.tgz", + "integrity": "sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==", "dev": true }, "@types/chai-as-promised": { @@ -15139,6 +15698,15 @@ "@types/chai": "*" } }, + "@types/chai-subset": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.3.tgz", + "integrity": "sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==", + "dev": true, + "requires": { + "@types/chai": "*" + } + }, "@types/color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", @@ -15711,6 +16279,88 @@ "eslint-visitor-keys": "^3.3.0" } }, + "@vitest/expect": { + "version": "0.31.4", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.31.4.tgz", + "integrity": "sha512-tibyx8o7GUyGHZGyPgzwiaPaLDQ9MMuCOrc03BYT0nryUuhLbL7NV2r/q98iv5STlwMgaKuFJkgBW/8iPKwlSg==", + "dev": true, + "requires": { + "@vitest/spy": "0.31.4", + "@vitest/utils": "0.31.4", + "chai": "^4.3.7" + } + }, + "@vitest/runner": { + "version": "0.31.4", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.31.4.tgz", + "integrity": "sha512-Wgm6UER+gwq6zkyrm5/wbpXGF+g+UBB78asJlFkIOwyse0pz8lZoiC6SW5i4gPnls/zUcPLWS7Zog0LVepXnpg==", + "dev": true, + "requires": { + "@vitest/utils": "0.31.4", + "concordance": "^5.0.4", + "p-limit": "^4.0.0", + "pathe": "^1.1.0" + }, + "dependencies": { + "p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "requires": { + "yocto-queue": "^1.0.0" + } + }, + "yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true + } + } + }, + "@vitest/snapshot": { + "version": "0.31.4", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.31.4.tgz", + "integrity": "sha512-LemvNumL3NdWSmfVAMpXILGyaXPkZbG5tyl6+RQSdcHnTj6hvA49UAI8jzez9oQyE/FWLKRSNqTGzsHuk89LRA==", + "dev": true, + "requires": { + "magic-string": "^0.30.0", + "pathe": "^1.1.0", + "pretty-format": "^27.5.1" + }, + "dependencies": { + "magic-string": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.0.tgz", + "integrity": "sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==", + "dev": true, + "requires": { + "@jridgewell/sourcemap-codec": "^1.4.13" + } + } + } + }, + "@vitest/spy": { + "version": "0.31.4", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.31.4.tgz", + "integrity": "sha512-3ei5ZH1s3aqbEyftPAzSuunGICRuhE+IXOmpURFdkm5ybUADk+viyQfejNk6q8M5QGX8/EVKw+QWMEP3DTJDag==", + "dev": true, + "requires": { + "tinyspy": "^2.1.0" + } + }, + "@vitest/utils": { + "version": "0.31.4", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.31.4.tgz", + "integrity": "sha512-DobZbHacWznoGUfYU8XDPY78UubJxXfMNY1+SUdOp1NsI34eopSA6aZMeaGu10waSOeYwE8lxrd/pLfT0RMxjQ==", + "dev": true, + "requires": { + "concordance": "^5.0.4", + "loupe": "^2.3.6", + "pretty-format": "^27.5.1" + } + }, "@webassemblyjs/ast": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", @@ -15891,9 +16541,9 @@ "dev": true }, "acorn": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", - "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", "dev": true }, "acorn-import-assertions": { @@ -16202,6 +16852,12 @@ "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", "dev": true }, + "blueimp-md5": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz", + "integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==", + "dev": true + }, "bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", @@ -16460,6 +17116,12 @@ "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==", "dev": true }, + "cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true + }, "cacheable-request": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", @@ -16804,6 +17466,48 @@ "typedarray": "^0.0.6" } }, + "concordance": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/concordance/-/concordance-5.0.4.tgz", + "integrity": "sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==", + "dev": true, + "requires": { + "date-time": "^3.1.0", + "esutils": "^2.0.3", + "fast-diff": "^1.2.0", + "js-string-escape": "^1.0.1", + "lodash": "^4.17.15", + "md5-hex": "^3.0.1", + "semver": "^7.3.2", + "well-known-symbols": "^2.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, "configstore": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", @@ -17215,6 +17919,15 @@ "assert-plus": "^1.0.0" } }, + "date-time": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/date-time/-/date-time-3.1.0.tgz", + "integrity": "sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==", + "dev": true, + "requires": { + "time-zone": "^1.0.0" + } + }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -18545,6 +19258,12 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true + }, "fast-equals": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-4.0.3.tgz", @@ -20009,6 +20728,12 @@ "integrity": "sha512-Y2/yD55y5jteOAmY50JbUZYwk3CP3wnLPEZnlR1w9oKhITrBEtAxwuWKebFf8hMrPMgbYwFoWK/lH2sBkErELw==", "dev": true }, + "js-string-escape": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", + "integrity": "sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==", + "dev": true + }, "js-yaml": { "version": "3.13.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", @@ -20209,6 +20934,12 @@ "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", "dev": true }, + "local-pkg": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz", + "integrity": "sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==", + "dev": true + }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -20310,9 +21041,9 @@ } }, "loupe": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz", - "integrity": "sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", + "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", "dev": true, "requires": { "get-func-name": "^2.0.0" @@ -20378,6 +21109,15 @@ "integrity": "sha512-yr8hSKa3Fv4D3jdZmtMMPghgVt6TWbk86WQaWhDloQjRSQhMMYCAro7jP7VDJrjjdV8pxVxMssXS8B8Y5DZ5aw==", "dev": true }, + "md5-hex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-3.0.1.tgz", + "integrity": "sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==", + "dev": true, + "requires": { + "blueimp-md5": "^2.10.0" + } + }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -20516,6 +21256,18 @@ "minimist": "^1.2.5" } }, + "mlly": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.3.0.tgz", + "integrity": "sha512-HT5mcgIQKkOrZecOjOX3DJorTikWXwsBfpcr/MGBkhfWcjiqvnaL/9ppxvIUXfjT6xt4DVIAsN9fMUz1ev4bIw==", + "dev": true, + "requires": { + "acorn": "^8.8.2", + "pathe": "^1.1.0", + "pkg-types": "^1.0.3", + "ufo": "^1.1.2" + } + }, "mocha": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", @@ -21388,6 +22140,12 @@ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true }, + "pathe": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.1.tgz", + "integrity": "sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==", + "dev": true + }, "pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", @@ -21446,6 +22204,17 @@ } } }, + "pkg-types": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", + "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", + "dev": true, + "requires": { + "jsonc-parser": "^3.2.0", + "mlly": "^1.2.0", + "pathe": "^1.1.0" + } + }, "pluralize": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", @@ -21492,6 +22261,31 @@ "integrity": "sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==", "dev": true }, + "pretty-format": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true + } + } + }, "prismjs": { "version": "1.27.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.27.0.tgz", @@ -21652,6 +22446,12 @@ "strip-json-comments": "~2.0.1" } }, + "react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true + }, "read": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", @@ -22277,6 +23077,12 @@ "object-inspect": "^1.9.0" } }, + "siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true + }, "signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", @@ -22476,12 +23282,24 @@ "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", "dev": true }, + "stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true + }, "statuses": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", "dev": true }, + "std-env": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.3.3.tgz", + "integrity": "sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg==", + "dev": true + }, "stealthy-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", @@ -22649,6 +23467,15 @@ "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true }, + "strip-literal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.0.1.tgz", + "integrity": "sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q==", + "dev": true, + "requires": { + "acorn": "^8.8.2" + } + }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -22742,6 +23569,12 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, + "time-zone": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz", + "integrity": "sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==", + "dev": true + }, "timers-browserify": { "version": "2.0.12", "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", @@ -22751,12 +23584,30 @@ "setimmediate": "^1.0.4" } }, + "tinybench": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.5.0.tgz", + "integrity": "sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA==", + "dev": true + }, "tinydate": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/tinydate/-/tinydate-1.3.0.tgz", "integrity": "sha512-7cR8rLy2QhYHpsBDBVYnnWXm8uRTr38RoZakFSW7Bs7PzfMPNZthuMLkwqZv7MTu8lhQ91cOFYS5a7iFj2oR3w==", "dev": true }, + "tinypool": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.5.0.tgz", + "integrity": "sha512-paHQtnrlS1QZYKF/GnLoOM/DN9fqaGOFbCbxzAhwniySnzl9Ebk8w73/dd34DAhe/obUbPAOldTyYXQZxnPBPQ==", + "dev": true + }, + "tinyspy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.1.1.tgz", + "integrity": "sha512-XPJL2uSzcOyBMky6OFrusqWlzfFrXtE0hPuMgW8A2HmaqrPo4ZQHRN/V0QXN3FSjKxpsbRrFc5LI7KOwBsT1/w==", + "dev": true + }, "to-readable-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", @@ -23141,6 +23992,12 @@ "integrity": "sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==", "dev": true }, + "ufo": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.1.2.tgz", + "integrity": "sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==", + "dev": true + }, "unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", @@ -23384,6 +24241,37 @@ "rollup": "^3.21.0" } }, + "vite-node": { + "version": "0.31.4", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.31.4.tgz", + "integrity": "sha512-uzL377GjJtTbuc5KQxVbDu2xfU/x0wVjUtXQR2ihS21q/NK6ROr4oG0rsSkBBddZUVCwzfx22in76/0ZZHXgkQ==", + "dev": true, + "requires": { + "cac": "^6.7.14", + "debug": "^4.3.4", + "mlly": "^1.2.0", + "pathe": "^1.1.0", + "picocolors": "^1.0.0", + "vite": "^3.0.0 || ^4.0.0" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, "vite-plugin-dts": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/vite-plugin-dts/-/vite-plugin-dts-2.3.0.tgz", @@ -23484,6 +24372,65 @@ } } }, + "vitest": { + "version": "0.31.4", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.31.4.tgz", + "integrity": "sha512-GoV0VQPmWrUFOZSg3RpQAPN+LPmHg2/gxlMNJlyxJihkz6qReHDV6b0pPDcqFLNEPya4tWJ1pgwUNP9MLmUfvQ==", + "dev": true, + "requires": { + "@types/chai": "^4.3.5", + "@types/chai-subset": "^1.3.3", + "@types/node": "*", + "@vitest/expect": "0.31.4", + "@vitest/runner": "0.31.4", + "@vitest/snapshot": "0.31.4", + "@vitest/spy": "0.31.4", + "@vitest/utils": "0.31.4", + "acorn": "^8.8.2", + "acorn-walk": "^8.2.0", + "cac": "^6.7.14", + "chai": "^4.3.7", + "concordance": "^5.0.4", + "debug": "^4.3.4", + "local-pkg": "^0.4.3", + "magic-string": "^0.30.0", + "pathe": "^1.1.0", + "picocolors": "^1.0.0", + "std-env": "^3.3.2", + "strip-literal": "^1.0.1", + "tinybench": "^2.5.0", + "tinypool": "^0.5.0", + "vite": "^3.0.0 || ^4.0.0", + "vite-node": "0.31.4", + "why-is-node-running": "^2.2.2" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "magic-string": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.0.tgz", + "integrity": "sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==", + "dev": true, + "requires": { + "@jridgewell/sourcemap-codec": "^1.4.13" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, "vm-browserify": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", @@ -23651,6 +24598,12 @@ "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", "dev": true }, + "well-known-symbols": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-2.0.0.tgz", + "integrity": "sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==", + "dev": true + }, "whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", @@ -23703,6 +24656,16 @@ "is-typed-array": "^1.1.10" } }, + "why-is-node-running": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", + "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "dev": true, + "requires": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + } + }, "widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", diff --git a/package.json b/package.json index 9860f519dd..7419559c00 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,7 @@ ], "scripts": { "build": "tsc && vite build", - "pretest": "rimraf ./build", - "test": "mocha --config=.mocharc.json", + "test": "vitest", "test.coverage": "nyc npm test", "test.watch": "npm test -- --watch", "prepublishOnly": "npm run build --omit=dev", @@ -124,6 +123,7 @@ "vite-plugin-dts": "^2.3.0", "vite-plugin-node-polyfills": "^0.8.2", "vite-tsconfig-paths": "^4.2.0", + "vitest": "^0.31.4", "webpack": "^5.28.0", "webpack-cli": "^5.0.0" }, diff --git a/src/export/formatter.spec.ts b/src/export/formatter.spec.ts index fed4319697..1ffc834056 100644 --- a/src/export/formatter.spec.ts +++ b/src/export/formatter.spec.ts @@ -1,4 +1,4 @@ -import { assert, expect } from "chai"; +import { assert, beforeEach, describe, expect, it } from "vitest"; import * as sinon from "sinon"; import { Formatter } from "@export/formatter"; diff --git a/src/export/packer/image-replacer.spec.ts b/src/export/packer/image-replacer.spec.ts index db7571cffa..f9f5f33e47 100644 --- a/src/export/packer/image-replacer.spec.ts +++ b/src/export/packer/image-replacer.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Media } from "@file/media"; diff --git a/src/export/packer/next-compiler.spec.ts b/src/export/packer/next-compiler.spec.ts index cad81c3f60..73e6d09105 100644 --- a/src/export/packer/next-compiler.spec.ts +++ b/src/export/packer/next-compiler.spec.ts @@ -1,180 +1,189 @@ -// /* tslint:disable:typedef space-before-function-paren */ -// import { expect } from "chai"; -// import * as sinon from "sinon"; +/* tslint:disable:typedef space-before-function-paren */ +import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import * as sinon from "sinon"; -// import { File } from "@file/file"; -// import { Footer, Header } from "@file/header"; -// import { ImageRun, Paragraph } from "@file/paragraph"; -// import * as convenienceFunctions from "@util/convenience-functions"; +import { File } from "@file/file"; +import { Footer, Header } from "@file/header"; +import { ImageRun, Paragraph } from "@file/paragraph"; +import * as convenienceFunctions from "@util/convenience-functions"; -// import { Compiler } from "./next-compiler"; +import { Compiler } from "./next-compiler"; -// describe("Compiler", () => { -// let compiler: Compiler; +describe("Compiler", () => { + let compiler: Compiler; -// beforeEach(() => { -// compiler = new Compiler(); -// }); + beforeEach(() => { + compiler = new Compiler(); + }); -// before(() => { -// sinon.stub(convenienceFunctions, "uniqueId").callsFake(() => "test"); -// }); + beforeAll(() => { + vi.spyOn(convenienceFunctions, "uniqueId").mockReturnValue("test"); + }); -// after(() => { -// (convenienceFunctions.uniqueId as sinon.SinonStub).restore(); -// }); + afterAll(() => { + vi.resetAllMocks(); + }); -// describe("#compile()", () => { -// it("should pack all the content", async function () { -// this.timeout(99999999); -// const file = new File({ -// sections: [], -// comments: { -// children: [], -// }, -// }); -// const zipFile = await compiler.compile(file); -// const fileNames = Object.keys(zipFile.files).map((f) => zipFile.files[f].name); + describe("#compile()", () => { + it( + "should pack all the content", + async () => { + const file = new File({ + sections: [], + comments: { + children: [], + }, + }); + const zipFile = await compiler.compile(file); + const fileNames = Object.keys(zipFile.files).map((f) => zipFile.files[f].name); -// expect(fileNames).is.an.instanceof(Array); -// expect(fileNames).has.length(17); -// expect(fileNames).to.include("word/document.xml"); -// expect(fileNames).to.include("word/styles.xml"); -// expect(fileNames).to.include("docProps/core.xml"); -// expect(fileNames).to.include("docProps/custom.xml"); -// expect(fileNames).to.include("docProps/app.xml"); -// expect(fileNames).to.include("word/numbering.xml"); -// expect(fileNames).to.include("word/footnotes.xml"); -// expect(fileNames).to.include("word/_rels/footnotes.xml.rels"); -// expect(fileNames).to.include("word/settings.xml"); -// expect(fileNames).to.include("word/comments.xml"); -// expect(fileNames).to.include("word/_rels/document.xml.rels"); -// expect(fileNames).to.include("[Content_Types].xml"); -// expect(fileNames).to.include("_rels/.rels"); -// }); + expect(fileNames).is.an.instanceof(Array); + expect(fileNames).has.length(17); + expect(fileNames).to.include("word/document.xml"); + expect(fileNames).to.include("word/styles.xml"); + expect(fileNames).to.include("docProps/core.xml"); + expect(fileNames).to.include("docProps/custom.xml"); + expect(fileNames).to.include("docProps/app.xml"); + expect(fileNames).to.include("word/numbering.xml"); + expect(fileNames).to.include("word/footnotes.xml"); + expect(fileNames).to.include("word/_rels/footnotes.xml.rels"); + expect(fileNames).to.include("word/settings.xml"); + expect(fileNames).to.include("word/comments.xml"); + expect(fileNames).to.include("word/_rels/document.xml.rels"); + expect(fileNames).to.include("[Content_Types].xml"); + expect(fileNames).to.include("_rels/.rels"); + }, + { + timeout: 99999999, + }, + ); -// it("should pack all additional headers and footers", function () { -// const file = new File({ -// sections: [ -// { -// headers: { -// default: new Header({ -// children: [new Paragraph("test")], -// }), -// }, -// footers: { -// default: new Footer({ -// children: [new Paragraph("test")], -// }), -// }, -// children: [], -// }, -// { -// headers: { -// default: new Header({ -// children: [new Paragraph("test")], -// }), -// }, -// footers: { -// default: new Footer({ -// children: [new Paragraph("test")], -// }), -// }, -// children: [], -// }, -// ], -// }); + it( + "should pack all additional headers and footers", + () => { + const file = new File({ + sections: [ + { + headers: { + default: new Header({ + children: [new Paragraph("test")], + }), + }, + footers: { + default: new Footer({ + children: [new Paragraph("test")], + }), + }, + children: [], + }, + { + headers: { + default: new Header({ + children: [new Paragraph("test")], + }), + }, + footers: { + default: new Footer({ + children: [new Paragraph("test")], + }), + }, + children: [], + }, + ], + }); -// this.timeout(99999999); + const zipFile = compiler.compile(file); + const fileNames = Object.keys(zipFile.files).map((f) => zipFile.files[f].name); -// const zipFile = compiler.compile(file); -// const fileNames = Object.keys(zipFile.files).map((f) => zipFile.files[f].name); + expect(fileNames).is.an.instanceof(Array); + expect(fileNames).has.length(25); -// expect(fileNames).is.an.instanceof(Array); -// expect(fileNames).has.length(25); + expect(fileNames).to.include("word/header1.xml"); + expect(fileNames).to.include("word/_rels/header1.xml.rels"); + expect(fileNames).to.include("word/header2.xml"); + expect(fileNames).to.include("word/_rels/header2.xml.rels"); + expect(fileNames).to.include("word/footer1.xml"); + expect(fileNames).to.include("word/_rels/footer1.xml.rels"); + expect(fileNames).to.include("word/footer2.xml"); + expect(fileNames).to.include("word/_rels/footer2.xml.rels"); + }, + { + timeout: 99999999, + }, + ); -// expect(fileNames).to.include("word/header1.xml"); -// expect(fileNames).to.include("word/_rels/header1.xml.rels"); -// expect(fileNames).to.include("word/header2.xml"); -// expect(fileNames).to.include("word/_rels/header2.xml.rels"); -// expect(fileNames).to.include("word/footer1.xml"); -// expect(fileNames).to.include("word/_rels/footer1.xml.rels"); -// expect(fileNames).to.include("word/footer2.xml"); -// expect(fileNames).to.include("word/_rels/footer2.xml.rels"); -// }); + it("should call the format method X times equalling X files to be formatted", () => { + // This test is required because before, there was a case where Document was formatted twice, which was inefficient + // This also caused issues such as running prepForXml multiple times as format() was ran multiple times. + const paragraph = new Paragraph(""); + const file = new File({ + sections: [ + { + properties: {}, + children: [paragraph], + }, + ], + }); -// it("should call the format method X times equalling X files to be formatted", () => { -// // This test is required because before, there was a case where Document was formatted twice, which was inefficient -// // This also caused issues such as running prepForXml multiple times as format() was ran multiple times. -// const paragraph = new Paragraph(""); -// const file = new File({ -// sections: [ -// { -// properties: {}, -// children: [paragraph], -// }, -// ], -// }); + // tslint:disable-next-line: no-string-literal + const spy = sinon.spy(compiler["formatter"], "format"); -// // tslint:disable-next-line: no-string-literal -// const spy = sinon.spy(compiler["formatter"], "format"); + compiler.compile(file); + expect(spy.callCount).to.equal(13); + }); -// compiler.compile(file); -// expect(spy.callCount).to.equal(13); -// }); + it("should work with media datas", () => { + // This test is required because before, there was a case where Document was formatted twice, which was inefficient + // This also caused issues such as running prepForXml multiple times as format() was ran multiple times. + const file = new File({ + sections: [ + { + headers: { + default: new Header({ + children: [new Paragraph("test")], + }), + }, + footers: { + default: new Footer({ + children: [new Paragraph("test")], + }), + }, + children: [ + new Paragraph({ + children: [ + new ImageRun({ + data: Buffer.from("", "base64"), + transformation: { + width: 100, + height: 100, + }, + }), + ], + }), + ], + }, + ], + }); -// it("should work with media datas", () => { -// // This test is required because before, there was a case where Document was formatted twice, which was inefficient -// // This also caused issues such as running prepForXml multiple times as format() was ran multiple times. -// const file = new File({ -// sections: [ -// { -// headers: { -// default: new Header({ -// children: [new Paragraph("test")], -// }), -// }, -// footers: { -// default: new Footer({ -// children: [new Paragraph("test")], -// }), -// }, -// children: [ -// new Paragraph({ -// children: [ -// new ImageRun({ -// data: Buffer.from("", "base64"), -// transformation: { -// width: 100, -// height: 100, -// }, -// }), -// ], -// }), -// ], -// }, -// ], -// }); + // tslint:disable-next-line: no-string-literal + sinon.stub(compiler["imageReplacer"], "getMediaData").returns([ + { + stream: Buffer.from(""), + fileName: "test", + transformation: { + pixels: { + x: 100, + y: 100, + }, + emus: { + x: 100, + y: 100, + }, + }, + }, + ]); -// // tslint:disable-next-line: no-string-literal -// sinon.stub(compiler["imageReplacer"], "getMediaData").returns([ -// { -// stream: Buffer.from(""), -// fileName: "test", -// transformation: { -// pixels: { -// x: 100, -// y: 100, -// }, -// emus: { -// x: 100, -// y: 100, -// }, -// }, -// }, -// ]); - -// compiler.compile(file); -// }); -// }); -// }); + compiler.compile(file); + }); + }); +}); diff --git a/src/export/packer/packer.spec.ts b/src/export/packer/packer.spec.ts index 7055db1e06..720917e6cf 100644 --- a/src/export/packer/packer.spec.ts +++ b/src/export/packer/packer.spec.ts @@ -1,6 +1,4 @@ -/* tslint:disable:typedef space-before-function-paren */ -import { assert } from "chai"; -import { mock, stub } from "sinon"; +import { afterEach, assert, beforeEach, describe, expect, it, vi } from "vitest"; import { File } from "@file/file"; import { HeadingLevel, Paragraph } from "@file/paragraph"; @@ -46,62 +44,71 @@ describe("Packer", () => { }); describe("#toBuffer()", () => { - it("should create a standard docx file", async function () { - this.timeout(99999999); - const buffer = await Packer.toBuffer(file); + it( + "should create a standard docx file", + async () => { + const buffer = await Packer.toBuffer(file); - assert.isDefined(buffer); - assert.isTrue(buffer.byteLength > 0); - }); + assert.isDefined(buffer); + assert.isTrue(buffer.byteLength > 0); + }, + { + timeout: 99999999, + }, + ); it("should handle exception if it throws any", () => { // eslint-disable-next-line @typescript-eslint/no-explicit-any - const compiler = stub((Packer as any).compiler, "compile"); + vi.spyOn((Packer as any).compiler, "compile").mockImplementation(() => { + throw new Error(); + }); - compiler.throwsException(); return Packer.toBuffer(file).catch((error) => { assert.isDefined(error); }); }); - after(() => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (Packer as any).compiler.compile.restore(); + afterEach(() => { + vi.restoreAllMocks(); }); }); describe("#toBase64String()", () => { - it("should create a standard docx file", async function () { - this.timeout(99999999); - const str = await Packer.toBase64String(file); - - assert.isDefined(str); - assert.isTrue(str.length > 0); - }); + it( + "should create a standard docx file", + async () => { + const str = await Packer.toBase64String(file); + expect(str).toBeDefined(); + expect(str.length).toBeGreaterThan(0); + }, + { + timeout: 99999999, + }, + ); it("should handle exception if it throws any", () => { // eslint-disable-next-line @typescript-eslint/no-explicit-any - const compiler = stub((Packer as any).compiler, "compile"); + vi.spyOn((Packer as any).compiler, "compile").mockImplementation(() => { + throw new Error(); + }); - compiler.throwsException(); return Packer.toBase64String(file).catch((error) => { assert.isDefined(error); }); }); - after(() => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (Packer as any).compiler.compile.restore(); + afterEach(() => { + vi.resetAllMocks(); }); }); describe("#toBlob()", () => { it("should create a standard docx file", async () => { // eslint-disable-next-line @typescript-eslint/no-explicit-any - stub((Packer as any).compiler, "compile").callsFake(() => ({ + vi.spyOn((Packer as any).compiler, "compile").mockReturnValue({ // tslint:disable-next-line: no-empty - generateAsync: () => mock({}), - })); + generateAsync: () => vi.fn(), + }); const str = await Packer.toBlob(file); assert.isDefined(str); @@ -109,35 +116,27 @@ describe("Packer", () => { it("should handle exception if it throws any", () => { // eslint-disable-next-line @typescript-eslint/no-explicit-any - const compiler = stub((Packer as any).compiler, "compile"); + vi.spyOn((Packer as any).compiler, "compile").mockImplementation(() => { + throw new Error(); + }); - compiler.throwsException(); return Packer.toBlob(file).catch((error) => { assert.isDefined(error); }); }); afterEach(() => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (Packer as any).compiler.compile.restore(); + vi.resetAllMocks(); }); }); describe("#toStream()", () => { it("should create a standard docx file", async () => { // eslint-disable-next-line @typescript-eslint/no-explicit-any - stub((Packer as any).compiler, "compile").callsFake(() => ({ - // tslint:disable-next-line: no-empty - generateNodeStream: () => ({ - on: (event: string, cb: () => void) => { - if (event === "end") { - cb(); - } - }, - }), - })); - const stream = await Packer.toStream(file); - return new Promise((resolve, reject) => { + vi.spyOn((Packer as any).compiler, "compile").mockReturnValue(Promise.resolve(new Uint8Array(255))); + const stream = Packer.toStream(file); + + const p = new Promise((resolve, reject) => { stream.on("error", () => { reject(new Error()); }); @@ -146,20 +145,15 @@ describe("Packer", () => { resolve(); }); }); + await p; }); it("should handle exception if it throws any", () => { // eslint-disable-next-line @typescript-eslint/no-explicit-any - const compiler = stub((Packer as any).compiler, "compile").callsFake(() => ({ - // tslint:disable-next-line: no-empty - on: (event: string, cb: () => void) => { - if (event === "error") { - cb(); - } - }, - })); + vi.spyOn((Packer as any).compiler, "compile").mockImplementation(() => { + throw new Error(); + }); - compiler.throwsException(); try { Packer.toStream(file); } catch (error) { @@ -168,8 +162,7 @@ describe("Packer", () => { }); afterEach(() => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (Packer as any).compiler.compile.restore(); + vi.resetAllMocks(); }); }); }); diff --git a/src/export/packer/packer.ts b/src/export/packer/packer.ts index 5816834e2c..6ce914a208 100644 --- a/src/export/packer/packer.ts +++ b/src/export/packer/packer.ts @@ -51,15 +51,12 @@ export class Packer { public static toStream(file: File, prettify?: boolean | PrettifyType): Stream { const zip = this.compiler.compile(file, prettify === true ? PrettifyType.WITH_2_BLANKS : prettify === false ? undefined : prettify); - const stream = new Stream(); - // eslint-disable-next-line functional/immutable-data - stream.pipe = (dest) => { - zip.then((z) => { - dest.write(z); - }); - return dest; - }; + + zip.then((z) => { + stream.emit("data", z); + stream.emit("end"); + }); return stream; } diff --git a/src/file/border/border.spec.ts b/src/file/border/border.spec.ts index b51ff6a434..ee01f47f04 100644 --- a/src/file/border/border.spec.ts +++ b/src/file/border/border.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { BorderStyle } from "@file/border"; diff --git a/src/file/content-types/content-types.spec.ts b/src/file/content-types/content-types.spec.ts index c66095fb80..54e70889b2 100644 --- a/src/file/content-types/content-types.spec.ts +++ b/src/file/content-types/content-types.spec.ts @@ -1,6 +1,6 @@ // tslint:disable:no-string-literal -import { expect } from "chai"; +import { beforeEach, describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/core-properties/properties.spec.ts b/src/file/core-properties/properties.spec.ts index f1dc16968c..133cc3e858 100644 --- a/src/file/core-properties/properties.spec.ts +++ b/src/file/core-properties/properties.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/custom-properties/custom-properties.spec.ts b/src/file/custom-properties/custom-properties.spec.ts index 4c4efe3392..e173ff844c 100644 --- a/src/file/custom-properties/custom-properties.spec.ts +++ b/src/file/custom-properties/custom-properties.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/document-wrapper.spec.ts b/src/file/document-wrapper.spec.ts index 7f54aad9c6..b8d4c5f6e0 100644 --- a/src/file/document-wrapper.spec.ts +++ b/src/file/document-wrapper.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { DocumentWrapper } from "./document-wrapper"; diff --git a/src/file/document/body/body.spec.ts b/src/file/document/body/body.spec.ts index c39acbb10b..8674777a84 100644 --- a/src/file/document/body/body.spec.ts +++ b/src/file/document/body/body.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { beforeEach, describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/document/body/section-properties/properties/columns.spec.ts b/src/file/document/body/section-properties/properties/columns.spec.ts index 8f0bcdd655..bde4ffebc7 100644 --- a/src/file/document/body/section-properties/properties/columns.spec.ts +++ b/src/file/document/body/section-properties/properties/columns.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/document/body/section-properties/properties/doc-grid.spec.ts b/src/file/document/body/section-properties/properties/doc-grid.spec.ts index 6ffae75860..f2ee945f48 100644 --- a/src/file/document/body/section-properties/properties/doc-grid.spec.ts +++ b/src/file/document/body/section-properties/properties/doc-grid.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/document/body/section-properties/properties/header-footer-reference.spec.ts b/src/file/document/body/section-properties/properties/header-footer-reference.spec.ts index 0a7ab4bebe..84f3d131f9 100644 --- a/src/file/document/body/section-properties/properties/header-footer-reference.spec.ts +++ b/src/file/document/body/section-properties/properties/header-footer-reference.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { HeaderFooterReference, HeaderFooterReferenceType, HeaderFooterType } from "./header-footer-reference"; diff --git a/src/file/document/body/section-properties/properties/page-borders.spec.ts b/src/file/document/body/section-properties/properties/page-borders.spec.ts index db1a4b1775..8890ca0eee 100644 --- a/src/file/document/body/section-properties/properties/page-borders.spec.ts +++ b/src/file/document/body/section-properties/properties/page-borders.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { BorderStyle } from "@file/border"; diff --git a/src/file/document/body/section-properties/properties/page-size.spec.ts b/src/file/document/body/section-properties/properties/page-size.spec.ts index 69285e6262..807d2312fc 100644 --- a/src/file/document/body/section-properties/properties/page-size.spec.ts +++ b/src/file/document/body/section-properties/properties/page-size.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/document/body/section-properties/properties/page-text-direction.spec.ts b/src/file/document/body/section-properties/properties/page-text-direction.spec.ts index 7e77840f54..e1a690d66c 100644 --- a/src/file/document/body/section-properties/properties/page-text-direction.spec.ts +++ b/src/file/document/body/section-properties/properties/page-text-direction.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { PageTextDirection, PageTextDirectionType } from "./page-text-direction"; diff --git a/src/file/document/body/section-properties/properties/section-type.spec.ts b/src/file/document/body/section-properties/properties/section-type.spec.ts index 0dd8622a5d..644e6d568f 100644 --- a/src/file/document/body/section-properties/properties/section-type.spec.ts +++ b/src/file/document/body/section-properties/properties/section-type.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { SectionType, Type } from "./section-type"; diff --git a/src/file/document/body/section-properties/section-properties.spec.ts b/src/file/document/body/section-properties/section-properties.spec.ts index 14de590e0a..cefee6d830 100644 --- a/src/file/document/body/section-properties/section-properties.spec.ts +++ b/src/file/document/body/section-properties/section-properties.spec.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { FooterWrapper } from "@file/footer-wrapper"; diff --git a/src/file/document/document-background/document-background.spec.ts b/src/file/document/document-background/document-background.spec.ts index 1cb08b1efb..7f83eb4d95 100644 --- a/src/file/document/document-background/document-background.spec.ts +++ b/src/file/document/document-background/document-background.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/document/document.spec.ts b/src/file/document/document.spec.ts index a0beae6cb6..b0fdd19f2f 100644 --- a/src/file/document/document.spec.ts +++ b/src/file/document/document.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { beforeEach, describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/drawing/anchor/anchor.spec.ts b/src/file/drawing/anchor/anchor.spec.ts index 64e628546e..5b5a0da764 100644 --- a/src/file/drawing/anchor/anchor.spec.ts +++ b/src/file/drawing/anchor/anchor.spec.ts @@ -1,4 +1,4 @@ -import { assert, expect } from "chai"; +import { assert, describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/drawing/doc-properties/doc-properties-children.spec.ts b/src/file/drawing/doc-properties/doc-properties-children.spec.ts index 826c732b8b..79bc669f36 100644 --- a/src/file/drawing/doc-properties/doc-properties-children.spec.ts +++ b/src/file/drawing/doc-properties/doc-properties-children.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/drawing/drawing.spec.ts b/src/file/drawing/drawing.spec.ts index c36f3e77ec..60fe335792 100644 --- a/src/file/drawing/drawing.spec.ts +++ b/src/file/drawing/drawing.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { IContext } from "@file/xml-components"; import { Formatter } from "@export/formatter"; diff --git a/src/file/drawing/floating/align.spec.ts b/src/file/drawing/floating/align.spec.ts index 491708acaf..fb25860feb 100644 --- a/src/file/drawing/floating/align.spec.ts +++ b/src/file/drawing/floating/align.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { VerticalPositionAlign } from "@file/shared/alignment"; diff --git a/src/file/drawing/floating/horizontal-position.spec.ts b/src/file/drawing/floating/horizontal-position.spec.ts index d049d67108..ad17580c07 100644 --- a/src/file/drawing/floating/horizontal-position.spec.ts +++ b/src/file/drawing/floating/horizontal-position.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { HorizontalPositionAlign } from "@file/shared/alignment"; diff --git a/src/file/drawing/floating/position-offset.spec.ts b/src/file/drawing/floating/position-offset.spec.ts index 6a0ce0ef6c..3c9009decf 100644 --- a/src/file/drawing/floating/position-offset.spec.ts +++ b/src/file/drawing/floating/position-offset.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/drawing/floating/simple-pos.spec.ts b/src/file/drawing/floating/simple-pos.spec.ts index b4f0a2565f..536f6177cc 100644 --- a/src/file/drawing/floating/simple-pos.spec.ts +++ b/src/file/drawing/floating/simple-pos.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/drawing/floating/vertical-position.spec.ts b/src/file/drawing/floating/vertical-position.spec.ts index 2c9fca9384..7d8762305a 100644 --- a/src/file/drawing/floating/vertical-position.spec.ts +++ b/src/file/drawing/floating/vertical-position.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { VerticalPositionAlign } from "@file/shared/alignment"; diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form.spec.ts b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form.spec.ts index d57df659c9..2e032a1638 100644 --- a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form.spec.ts +++ b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { Form } from "./form/form"; diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/no-fill.spec.ts b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/no-fill.spec.ts index 670a9a86b0..13e18ba80b 100644 --- a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/no-fill.spec.ts +++ b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/no-fill.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/outline.spec.ts b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/outline.spec.ts index eb4e148afe..961f3d1595 100644 --- a/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/outline.spec.ts +++ b/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/outline.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { Outline } from "./outline"; diff --git a/src/file/file.spec.ts b/src/file/file.spec.ts index 287de447a4..ac0098a379 100644 --- a/src/file/file.spec.ts +++ b/src/file/file.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/footer-wrapper.spec.ts b/src/file/footer-wrapper.spec.ts index 91187474cd..62fe164cf0 100644 --- a/src/file/footer-wrapper.spec.ts +++ b/src/file/footer-wrapper.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import * as sinon from "sinon"; import { FooterWrapper } from "./footer-wrapper"; diff --git a/src/file/footer/footer.spec.ts b/src/file/footer/footer.spec.ts index a5d408392e..e040b2f325 100644 --- a/src/file/footer/footer.spec.ts +++ b/src/file/footer/footer.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/footnotes-wrapper.spec.ts b/src/file/footnotes-wrapper.spec.ts index 4318ab0fdd..8bf91ac5d1 100644 --- a/src/file/footnotes-wrapper.spec.ts +++ b/src/file/footnotes-wrapper.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { FootnotesWrapper } from "./footnotes-wrapper"; diff --git a/src/file/footnotes/footnote/footnote.spec.ts b/src/file/footnotes/footnote/footnote.spec.ts index b5f347ce49..61af5e91fb 100644 --- a/src/file/footnotes/footnote/footnote.spec.ts +++ b/src/file/footnotes/footnote/footnote.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { Paragraph, TextRun } from "@file/paragraph"; diff --git a/src/file/header-wrapper.spec.ts b/src/file/header-wrapper.spec.ts index 9731513537..5d9cef9dff 100644 --- a/src/file/header-wrapper.spec.ts +++ b/src/file/header-wrapper.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import * as sinon from "sinon"; import { HeaderWrapper } from "./header-wrapper"; diff --git a/src/file/header/header.spec.ts b/src/file/header/header.spec.ts index c124a08815..abea9d8e85 100644 --- a/src/file/header/header.spec.ts +++ b/src/file/header/header.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/media/media.spec.ts b/src/file/media/media.spec.ts index e400b347bf..1e59502726 100644 --- a/src/file/media/media.spec.ts +++ b/src/file/media/media.spec.ts @@ -1,18 +1,17 @@ // tslint:disable:object-literal-key-quotes -import { expect } from "chai"; -import { SinonStub, stub } from "sinon"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import * as convenienceFunctions from "@util/convenience-functions"; import { Media } from "./media"; describe("Media", () => { - before(() => { - stub(convenienceFunctions, "uniqueId").callsFake(() => "test"); + beforeEach(() => { + vi.spyOn(convenienceFunctions, "uniqueId").mockReturnValue("test"); }); - after(() => { - (convenienceFunctions.uniqueId as SinonStub).restore(); + afterEach(() => { + vi.resetAllMocks(); }); describe("#Array", () => { diff --git a/src/file/numbering/abstract-numbering.spec.ts b/src/file/numbering/abstract-numbering.spec.ts index 98569ede5a..cb0bd96fa8 100644 --- a/src/file/numbering/abstract-numbering.spec.ts +++ b/src/file/numbering/abstract-numbering.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/numbering/concrete-numbering.spec.ts b/src/file/numbering/concrete-numbering.spec.ts index 1239a2b4fc..db911505d8 100644 --- a/src/file/numbering/concrete-numbering.spec.ts +++ b/src/file/numbering/concrete-numbering.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/numbering/level.spec.ts b/src/file/numbering/level.spec.ts index 2216dc1555..988322c34e 100644 --- a/src/file/numbering/level.spec.ts +++ b/src/file/numbering/level.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/numbering/numbering.spec.ts b/src/file/numbering/numbering.spec.ts index 056d4bd356..4efbc75b01 100644 --- a/src/file/numbering/numbering.spec.ts +++ b/src/file/numbering/numbering.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/formatting/alignment.spec.ts b/src/file/paragraph/formatting/alignment.spec.ts index 9fcca0a5c7..34048190f6 100644 --- a/src/file/paragraph/formatting/alignment.spec.ts +++ b/src/file/paragraph/formatting/alignment.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { Alignment, AlignmentType } from "./alignment"; diff --git a/src/file/paragraph/formatting/border.spec.ts b/src/file/paragraph/formatting/border.spec.ts index 5071d92bbe..e6ab032fac 100644 --- a/src/file/paragraph/formatting/border.spec.ts +++ b/src/file/paragraph/formatting/border.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { beforeEach, describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/formatting/break.spec.ts b/src/file/paragraph/formatting/break.spec.ts index 7d41e3ed42..ec1ddb17f3 100644 --- a/src/file/paragraph/formatting/break.spec.ts +++ b/src/file/paragraph/formatting/break.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { beforeEach, describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/formatting/indent.spec.ts b/src/file/paragraph/formatting/indent.spec.ts index 4f00d89ee4..a51fe2efc8 100644 --- a/src/file/paragraph/formatting/indent.spec.ts +++ b/src/file/paragraph/formatting/indent.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/formatting/spacing.spec.ts b/src/file/paragraph/formatting/spacing.spec.ts index 3a3cc23c64..f12dbe1651 100644 --- a/src/file/paragraph/formatting/spacing.spec.ts +++ b/src/file/paragraph/formatting/spacing.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/formatting/style.spec.ts b/src/file/paragraph/formatting/style.spec.ts index 0bf230c4bf..156bccd956 100644 --- a/src/file/paragraph/formatting/style.spec.ts +++ b/src/file/paragraph/formatting/style.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/formatting/tab-stop.spec.ts b/src/file/paragraph/formatting/tab-stop.spec.ts index 40afd9965a..0cfb676731 100644 --- a/src/file/paragraph/formatting/tab-stop.spec.ts +++ b/src/file/paragraph/formatting/tab-stop.spec.ts @@ -1,4 +1,4 @@ -import { assert } from "chai"; +import { assert, beforeEach, describe, it } from "vitest"; import { Utility } from "tests/utility"; diff --git a/src/file/paragraph/formatting/unordered-list.spec.ts b/src/file/paragraph/formatting/unordered-list.spec.ts index cc0181c2db..791dbbcb4c 100644 --- a/src/file/paragraph/formatting/unordered-list.spec.ts +++ b/src/file/paragraph/formatting/unordered-list.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/formatting/word-wrap.spec.ts b/src/file/paragraph/formatting/word-wrap.spec.ts index acf8b7de1f..e3903c9719 100644 --- a/src/file/paragraph/formatting/word-wrap.spec.ts +++ b/src/file/paragraph/formatting/word-wrap.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/frame/frame-properties.spec.ts b/src/file/paragraph/frame/frame-properties.spec.ts index 495bad9d20..5ff7afaef3 100644 --- a/src/file/paragraph/frame/frame-properties.spec.ts +++ b/src/file/paragraph/frame/frame-properties.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { HorizontalPositionAlign, VerticalPositionAlign } from "@file/shared"; diff --git a/src/file/paragraph/links/bookmark.spec.ts b/src/file/paragraph/links/bookmark.spec.ts index d3cdb22864..3df1777ad2 100644 --- a/src/file/paragraph/links/bookmark.spec.ts +++ b/src/file/paragraph/links/bookmark.spec.ts @@ -1,4 +1,4 @@ -import { assert, expect } from "chai"; +import { assert, beforeEach, describe, expect, it } from "vitest"; import { Utility } from "tests/utility"; diff --git a/src/file/paragraph/links/hyperlink.spec.ts b/src/file/paragraph/links/hyperlink.spec.ts index 8ef9e532b6..d708e91b02 100644 --- a/src/file/paragraph/links/hyperlink.spec.ts +++ b/src/file/paragraph/links/hyperlink.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { beforeEach, describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/links/outline-level.spec.ts b/src/file/paragraph/links/outline-level.spec.ts index 7b58d704fe..436aba3eca 100644 --- a/src/file/paragraph/links/outline-level.spec.ts +++ b/src/file/paragraph/links/outline-level.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/links/pageref-field-instruction.spec.ts b/src/file/paragraph/links/pageref-field-instruction.spec.ts index b113c84cd1..ece399a385 100644 --- a/src/file/paragraph/links/pageref-field-instruction.spec.ts +++ b/src/file/paragraph/links/pageref-field-instruction.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { PageReferenceFieldInstruction } from "./pageref-field-instruction"; diff --git a/src/file/paragraph/links/pageref.spec.ts b/src/file/paragraph/links/pageref.spec.ts index f65cd2be67..ae214bfbc5 100644 --- a/src/file/paragraph/links/pageref.spec.ts +++ b/src/file/paragraph/links/pageref.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { PageReference } from "./pageref"; diff --git a/src/file/paragraph/math/brackets/math-angled-brackets.spec.ts b/src/file/paragraph/math/brackets/math-angled-brackets.spec.ts index 4e147deca8..92729e6225 100644 --- a/src/file/paragraph/math/brackets/math-angled-brackets.spec.ts +++ b/src/file/paragraph/math/brackets/math-angled-brackets.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/brackets/math-beginning-character.spec.ts b/src/file/paragraph/math/brackets/math-beginning-character.spec.ts index 8306228161..9ca4a7cbd5 100644 --- a/src/file/paragraph/math/brackets/math-beginning-character.spec.ts +++ b/src/file/paragraph/math/brackets/math-beginning-character.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/brackets/math-bracket-properties.spec.ts b/src/file/paragraph/math/brackets/math-bracket-properties.spec.ts index 59b0dbb482..3e77cda292 100644 --- a/src/file/paragraph/math/brackets/math-bracket-properties.spec.ts +++ b/src/file/paragraph/math/brackets/math-bracket-properties.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/brackets/math-curly-brackets.spec.ts b/src/file/paragraph/math/brackets/math-curly-brackets.spec.ts index 4df8f16499..63ecdbe06c 100644 --- a/src/file/paragraph/math/brackets/math-curly-brackets.spec.ts +++ b/src/file/paragraph/math/brackets/math-curly-brackets.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/brackets/math-ending-character.spec.ts b/src/file/paragraph/math/brackets/math-ending-character.spec.ts index ffbfed444d..f81921872e 100644 --- a/src/file/paragraph/math/brackets/math-ending-character.spec.ts +++ b/src/file/paragraph/math/brackets/math-ending-character.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/brackets/math-round-brackets.spec.ts b/src/file/paragraph/math/brackets/math-round-brackets.spec.ts index 2514e8149e..753907139c 100644 --- a/src/file/paragraph/math/brackets/math-round-brackets.spec.ts +++ b/src/file/paragraph/math/brackets/math-round-brackets.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/brackets/math-square-brackets.spec.ts b/src/file/paragraph/math/brackets/math-square-brackets.spec.ts index ba53d7a918..6624506cd6 100644 --- a/src/file/paragraph/math/brackets/math-square-brackets.spec.ts +++ b/src/file/paragraph/math/brackets/math-square-brackets.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/fraction/math-denominator.spec.ts b/src/file/paragraph/math/fraction/math-denominator.spec.ts index e899da4bd7..97381a69a0 100644 --- a/src/file/paragraph/math/fraction/math-denominator.spec.ts +++ b/src/file/paragraph/math/fraction/math-denominator.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/fraction/math-fraction.spec.ts b/src/file/paragraph/math/fraction/math-fraction.spec.ts index 0613960f8b..3b29f742e4 100644 --- a/src/file/paragraph/math/fraction/math-fraction.spec.ts +++ b/src/file/paragraph/math/fraction/math-fraction.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/fraction/math-numerator.spec.ts b/src/file/paragraph/math/fraction/math-numerator.spec.ts index 104b9ee85d..4ca7d836cd 100644 --- a/src/file/paragraph/math/fraction/math-numerator.spec.ts +++ b/src/file/paragraph/math/fraction/math-numerator.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/function/math-function-name.spec.ts b/src/file/paragraph/math/function/math-function-name.spec.ts index fc2930f8d8..2776156cbd 100644 --- a/src/file/paragraph/math/function/math-function-name.spec.ts +++ b/src/file/paragraph/math/function/math-function-name.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/function/math-function-properties.spec.ts b/src/file/paragraph/math/function/math-function-properties.spec.ts index 10be672efe..993868e687 100644 --- a/src/file/paragraph/math/function/math-function-properties.spec.ts +++ b/src/file/paragraph/math/function/math-function-properties.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/function/math-function.spec.ts b/src/file/paragraph/math/function/math-function.spec.ts index 7e3379e8af..0d0b5897ce 100644 --- a/src/file/paragraph/math/function/math-function.spec.ts +++ b/src/file/paragraph/math/function/math-function.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/math-run.spec.ts b/src/file/paragraph/math/math-run.spec.ts index dbc12622cb..c0bc6d7eaa 100644 --- a/src/file/paragraph/math/math-run.spec.ts +++ b/src/file/paragraph/math/math-run.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/math-text.spec.ts b/src/file/paragraph/math/math-text.spec.ts index c9d4fe05c0..ee7ed47bcb 100644 --- a/src/file/paragraph/math/math-text.spec.ts +++ b/src/file/paragraph/math/math-text.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/math.spec.ts b/src/file/paragraph/math/math.spec.ts index cc2591d0e2..b7935886c2 100644 --- a/src/file/paragraph/math/math.spec.ts +++ b/src/file/paragraph/math/math.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/n-ary/math-accent-character.spec.ts b/src/file/paragraph/math/n-ary/math-accent-character.spec.ts index 7ab553278d..afb4d98b69 100644 --- a/src/file/paragraph/math/n-ary/math-accent-character.spec.ts +++ b/src/file/paragraph/math/n-ary/math-accent-character.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/n-ary/math-base.spec.ts b/src/file/paragraph/math/n-ary/math-base.spec.ts index fb4d2de0f6..0d4a8c8a3c 100644 --- a/src/file/paragraph/math/n-ary/math-base.spec.ts +++ b/src/file/paragraph/math/n-ary/math-base.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/n-ary/math-integral.spec.ts b/src/file/paragraph/math/n-ary/math-integral.spec.ts index a5f776cc42..bc7be34283 100644 --- a/src/file/paragraph/math/n-ary/math-integral.spec.ts +++ b/src/file/paragraph/math/n-ary/math-integral.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/n-ary/math-limit-location.spec.ts b/src/file/paragraph/math/n-ary/math-limit-location.spec.ts index 96ab07785f..91ba473c83 100644 --- a/src/file/paragraph/math/n-ary/math-limit-location.spec.ts +++ b/src/file/paragraph/math/n-ary/math-limit-location.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/n-ary/math-n-ary-properties.spec.ts b/src/file/paragraph/math/n-ary/math-n-ary-properties.spec.ts index 03111874d4..131a275461 100644 --- a/src/file/paragraph/math/n-ary/math-n-ary-properties.spec.ts +++ b/src/file/paragraph/math/n-ary/math-n-ary-properties.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/n-ary/math-sub-script-hide.spec.ts b/src/file/paragraph/math/n-ary/math-sub-script-hide.spec.ts index 7f4ed9ced9..19148530d7 100644 --- a/src/file/paragraph/math/n-ary/math-sub-script-hide.spec.ts +++ b/src/file/paragraph/math/n-ary/math-sub-script-hide.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/n-ary/math-sub-script.spec.ts b/src/file/paragraph/math/n-ary/math-sub-script.spec.ts index 0b98a1d5f9..6b1a783165 100644 --- a/src/file/paragraph/math/n-ary/math-sub-script.spec.ts +++ b/src/file/paragraph/math/n-ary/math-sub-script.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/n-ary/math-sum.spec.ts b/src/file/paragraph/math/n-ary/math-sum.spec.ts index 7214446a4e..eba2aa0448 100644 --- a/src/file/paragraph/math/n-ary/math-sum.spec.ts +++ b/src/file/paragraph/math/n-ary/math-sum.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/n-ary/math-super-script-hide.spec.ts b/src/file/paragraph/math/n-ary/math-super-script-hide.spec.ts index 7157bebe00..85cb0c40af 100644 --- a/src/file/paragraph/math/n-ary/math-super-script-hide.spec.ts +++ b/src/file/paragraph/math/n-ary/math-super-script-hide.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/n-ary/math-super-script.spec.ts b/src/file/paragraph/math/n-ary/math-super-script.spec.ts index ea7a538401..54556f2ec1 100644 --- a/src/file/paragraph/math/n-ary/math-super-script.spec.ts +++ b/src/file/paragraph/math/n-ary/math-super-script.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/radical/math-degree-hide.spec.ts b/src/file/paragraph/math/radical/math-degree-hide.spec.ts index 5e9ce50fda..ea9002b54f 100644 --- a/src/file/paragraph/math/radical/math-degree-hide.spec.ts +++ b/src/file/paragraph/math/radical/math-degree-hide.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/radical/math-degree.spec.ts b/src/file/paragraph/math/radical/math-degree.spec.ts index 656d8d8ac9..0bb7220410 100644 --- a/src/file/paragraph/math/radical/math-degree.spec.ts +++ b/src/file/paragraph/math/radical/math-degree.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/radical/math-radical-properties.spec.ts b/src/file/paragraph/math/radical/math-radical-properties.spec.ts index 75f3db07cf..4510211c34 100644 --- a/src/file/paragraph/math/radical/math-radical-properties.spec.ts +++ b/src/file/paragraph/math/radical/math-radical-properties.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/radical/math-radical.spec.ts b/src/file/paragraph/math/radical/math-radical.spec.ts index b065794f74..24468b6c85 100644 --- a/src/file/paragraph/math/radical/math-radical.spec.ts +++ b/src/file/paragraph/math/radical/math-radical.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/script/pre-sub-super-script/math-pre-sub-super-script-function-properties.spec.ts b/src/file/paragraph/math/script/pre-sub-super-script/math-pre-sub-super-script-function-properties.spec.ts index 6da12e9082..e91979d61a 100644 --- a/src/file/paragraph/math/script/pre-sub-super-script/math-pre-sub-super-script-function-properties.spec.ts +++ b/src/file/paragraph/math/script/pre-sub-super-script/math-pre-sub-super-script-function-properties.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { MathPreSubSuperScriptProperties } from "./math-pre-sub-super-script-function-properties"; diff --git a/src/file/paragraph/math/script/pre-sub-super-script/math-pre-sub-super-script-function.spec.ts b/src/file/paragraph/math/script/pre-sub-super-script/math-pre-sub-super-script-function.spec.ts index 3311abd304..9fff56f516 100644 --- a/src/file/paragraph/math/script/pre-sub-super-script/math-pre-sub-super-script-function.spec.ts +++ b/src/file/paragraph/math/script/pre-sub-super-script/math-pre-sub-super-script-function.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/script/sub-script/math-sub-script-function-properties.spec.ts b/src/file/paragraph/math/script/sub-script/math-sub-script-function-properties.spec.ts index c02b114d31..81009ce1eb 100644 --- a/src/file/paragraph/math/script/sub-script/math-sub-script-function-properties.spec.ts +++ b/src/file/paragraph/math/script/sub-script/math-sub-script-function-properties.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { MathSubScriptProperties } from "./math-sub-script-function-properties"; diff --git a/src/file/paragraph/math/script/sub-script/math-sub-script-function.spec.ts b/src/file/paragraph/math/script/sub-script/math-sub-script-function.spec.ts index 3a5435167d..235ac20898 100644 --- a/src/file/paragraph/math/script/sub-script/math-sub-script-function.spec.ts +++ b/src/file/paragraph/math/script/sub-script/math-sub-script-function.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/script/sub-super-script/math-sub-super-script-function-properties.spec.ts b/src/file/paragraph/math/script/sub-super-script/math-sub-super-script-function-properties.spec.ts index af5db454b1..396c6c274b 100644 --- a/src/file/paragraph/math/script/sub-super-script/math-sub-super-script-function-properties.spec.ts +++ b/src/file/paragraph/math/script/sub-super-script/math-sub-super-script-function-properties.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { MathSubSuperScriptProperties } from "./math-sub-super-script-function-properties"; diff --git a/src/file/paragraph/math/script/sub-super-script/math-sub-super-script-function.spec.ts b/src/file/paragraph/math/script/sub-super-script/math-sub-super-script-function.spec.ts index 6edcee075a..5a81747462 100644 --- a/src/file/paragraph/math/script/sub-super-script/math-sub-super-script-function.spec.ts +++ b/src/file/paragraph/math/script/sub-super-script/math-sub-super-script-function.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/math/script/super-script/math-super-script-function-properties.spec.ts b/src/file/paragraph/math/script/super-script/math-super-script-function-properties.spec.ts index b6d213f481..0636ef7cd7 100644 --- a/src/file/paragraph/math/script/super-script/math-super-script-function-properties.spec.ts +++ b/src/file/paragraph/math/script/super-script/math-super-script-function-properties.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { MathSuperScriptProperties } from "./math-super-script-function-properties"; diff --git a/src/file/paragraph/math/script/super-script/math-super-script-function.spec.ts b/src/file/paragraph/math/script/super-script/math-super-script-function.spec.ts index 8b3ab1fcad..28bc699114 100644 --- a/src/file/paragraph/math/script/super-script/math-super-script-function.spec.ts +++ b/src/file/paragraph/math/script/super-script/math-super-script-function.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/paragraph.spec.ts b/src/file/paragraph/paragraph.spec.ts index 8f7ed03801..6e911cd145 100644 --- a/src/file/paragraph/paragraph.spec.ts +++ b/src/file/paragraph/paragraph.spec.ts @@ -1,5 +1,4 @@ -import { assert, expect } from "chai"; -import { SinonStub, stub } from "sinon"; +import { afterEach, assert, beforeEach, describe, expect, it, vi } from "vitest"; import * as convenienceFunctions from "@util/convenience-functions"; @@ -18,14 +17,13 @@ import { Paragraph } from "./paragraph"; import { TextRun } from "./run"; describe("Paragraph", () => { - before(() => { - stub(convenienceFunctions, "uniqueId").callsFake(() => "test-unique-id"); - stub(convenienceFunctions, "bookmarkUniqueNumericIdGen").callsFake(() => () => -101); + beforeEach(() => { + vi.spyOn(convenienceFunctions, "uniqueId").mockReturnValue("test-unique-id"); + vi.spyOn(convenienceFunctions, "bookmarkUniqueNumericIdGen").mockReturnValue(() => -101); }); - after(() => { - (convenienceFunctions.uniqueId as SinonStub).restore(); - (convenienceFunctions.bookmarkUniqueNumericIdGen as SinonStub).restore(); + afterEach(() => { + vi.restoreAllMocks(); }); describe("#constructor()", () => { diff --git a/src/file/paragraph/properties.spec.ts b/src/file/paragraph/properties.spec.ts index cfa0d3aced..439232d943 100644 --- a/src/file/paragraph/properties.spec.ts +++ b/src/file/paragraph/properties.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { DocumentWrapper } from "../document-wrapper"; diff --git a/src/file/paragraph/run/break.spec.ts b/src/file/paragraph/run/break.spec.ts index dbd96cc26f..702783d637 100644 --- a/src/file/paragraph/run/break.spec.ts +++ b/src/file/paragraph/run/break.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { beforeEach, describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/run/comment-run.spec.ts b/src/file/paragraph/run/comment-run.spec.ts index 1fa9aab101..ce269883cd 100644 --- a/src/file/paragraph/run/comment-run.spec.ts +++ b/src/file/paragraph/run/comment-run.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { afterEach, beforeEach, describe, expect, it } from "vitest"; import * as sinon from "sinon"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/run/emphasis-mark.spec.ts b/src/file/paragraph/run/emphasis-mark.spec.ts index d37bbdffd1..592709ff95 100644 --- a/src/file/paragraph/run/emphasis-mark.spec.ts +++ b/src/file/paragraph/run/emphasis-mark.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/run/empty-children.spec.ts b/src/file/paragraph/run/empty-children.spec.ts index af9ccb4e35..24615575e1 100644 --- a/src/file/paragraph/run/empty-children.spec.ts +++ b/src/file/paragraph/run/empty-children.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { diff --git a/src/file/paragraph/run/formatting.spec.ts b/src/file/paragraph/run/formatting.spec.ts index 4c8da63fc8..3c1e4c7a82 100644 --- a/src/file/paragraph/run/formatting.spec.ts +++ b/src/file/paragraph/run/formatting.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/run/image-run.spec.ts b/src/file/paragraph/run/image-run.spec.ts index 2dc3cd2557..77eff04070 100644 --- a/src/file/paragraph/run/image-run.spec.ts +++ b/src/file/paragraph/run/image-run.spec.ts @@ -1,5 +1,4 @@ -import { expect } from "chai"; -import { SinonStub, stub } from "sinon"; +import { afterAll, beforeAll, describe, expect, it, vi } from "vitest"; import { Formatter } from "@export/formatter"; import { IViewWrapper } from "@file/document-wrapper"; @@ -9,12 +8,12 @@ import * as convenienceFunctions from "@util/convenience-functions"; import { ImageRun } from "./image-run"; describe("ImageRun", () => { - before(() => { - stub(convenienceFunctions, "uniqueId").callsFake(() => "test-unique-id"); + beforeAll(() => { + vi.spyOn(convenienceFunctions, "uniqueId").mockReturnValue("test-unique-id"); }); - after(() => { - (convenienceFunctions.uniqueId as SinonStub).restore(); + afterAll(() => { + vi.resetAllMocks(); }); describe("#constructor()", () => { diff --git a/src/file/paragraph/run/language.spec.ts b/src/file/paragraph/run/language.spec.ts index e742c6092c..93eb039312 100644 --- a/src/file/paragraph/run/language.spec.ts +++ b/src/file/paragraph/run/language.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/run/page-number.spec.ts b/src/file/paragraph/run/page-number.spec.ts index eb5861d52e..4b3c51a8fd 100644 --- a/src/file/paragraph/run/page-number.spec.ts +++ b/src/file/paragraph/run/page-number.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/run/positional-tab.spec.ts b/src/file/paragraph/run/positional-tab.spec.ts index 56fe20c273..6c86e6f3d2 100644 --- a/src/file/paragraph/run/positional-tab.spec.ts +++ b/src/file/paragraph/run/positional-tab.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/run/run-components/symbol.spec.ts b/src/file/paragraph/run/run-components/symbol.spec.ts index 7df914a2e2..7aecb1a11a 100644 --- a/src/file/paragraph/run/run-components/symbol.spec.ts +++ b/src/file/paragraph/run/run-components/symbol.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/run/run-components/text.spec.ts b/src/file/paragraph/run/run-components/text.spec.ts index c01606d632..92860fab69 100644 --- a/src/file/paragraph/run/run-components/text.spec.ts +++ b/src/file/paragraph/run/run-components/text.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { SpaceType } from "@file/shared"; diff --git a/src/file/paragraph/run/run-fonts.spec.ts b/src/file/paragraph/run/run-fonts.spec.ts index 3e8df6c68c..6e2c8d88dc 100644 --- a/src/file/paragraph/run/run-fonts.spec.ts +++ b/src/file/paragraph/run/run-fonts.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/run/run.spec.ts b/src/file/paragraph/run/run.spec.ts index b639e08e49..b2027c2cfb 100644 --- a/src/file/paragraph/run/run.spec.ts +++ b/src/file/paragraph/run/run.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { BorderStyle } from "@file/border"; diff --git a/src/file/paragraph/run/script.spec.ts b/src/file/paragraph/run/script.spec.ts index 7d7a8cb1da..1b06e1ae9d 100644 --- a/src/file/paragraph/run/script.spec.ts +++ b/src/file/paragraph/run/script.spec.ts @@ -1,4 +1,4 @@ -import { assert } from "chai"; +import { assert, beforeEach, describe, it } from "vitest"; import { Utility } from "tests/utility"; diff --git a/src/file/paragraph/run/sequential-identifier.spec.ts b/src/file/paragraph/run/sequential-identifier.spec.ts index f68c356ec9..f8cc3594ab 100644 --- a/src/file/paragraph/run/sequential-identifier.spec.ts +++ b/src/file/paragraph/run/sequential-identifier.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/run/simple-field.spec.ts b/src/file/paragraph/run/simple-field.spec.ts index ac42bafdf4..732c00626a 100644 --- a/src/file/paragraph/run/simple-field.spec.ts +++ b/src/file/paragraph/run/simple-field.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/run/symbol-run.spec.ts b/src/file/paragraph/run/symbol-run.spec.ts index 3aab0b1e83..47db16466c 100644 --- a/src/file/paragraph/run/symbol-run.spec.ts +++ b/src/file/paragraph/run/symbol-run.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/paragraph/run/text-run.spec.ts b/src/file/paragraph/run/text-run.spec.ts index d3a3c82383..59ecb1fa08 100644 --- a/src/file/paragraph/run/text-run.spec.ts +++ b/src/file/paragraph/run/text-run.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { FootnoteReferenceRun } from "@file/footnotes/footnote/run/reference-run"; diff --git a/src/file/paragraph/run/underline.spec.ts b/src/file/paragraph/run/underline.spec.ts index c8a26b3e78..7bfe32a562 100644 --- a/src/file/paragraph/run/underline.spec.ts +++ b/src/file/paragraph/run/underline.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/relationships/relationships.spec.ts b/src/file/relationships/relationships.spec.ts index fd47ec55c6..c21c9d0dd2 100644 --- a/src/file/relationships/relationships.spec.ts +++ b/src/file/relationships/relationships.spec.ts @@ -1,5 +1,5 @@ // tslint:disable:no-string-literal -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/settings/compatibility-setting/compatibility-setting.spec.ts b/src/file/settings/compatibility-setting/compatibility-setting.spec.ts index 7d927f283e..d05d46032f 100644 --- a/src/file/settings/compatibility-setting/compatibility-setting.spec.ts +++ b/src/file/settings/compatibility-setting/compatibility-setting.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/settings/compatibility.spec.ts b/src/file/settings/compatibility.spec.ts index 102f7375d0..129e0d1266 100644 --- a/src/file/settings/compatibility.spec.ts +++ b/src/file/settings/compatibility.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/settings/settings.spec.ts b/src/file/settings/settings.spec.ts index 8ee5b728f2..13666f4a84 100644 --- a/src/file/settings/settings.spec.ts +++ b/src/file/settings/settings.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/shading/shading.spec.ts b/src/file/shading/shading.spec.ts index 7db9ca2859..45d4a96065 100644 --- a/src/file/shading/shading.spec.ts +++ b/src/file/shading/shading.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/styles/defaults/document-defaults.spec.ts b/src/file/styles/defaults/document-defaults.spec.ts index ccf4607941..c6ff2251c3 100644 --- a/src/file/styles/defaults/document-defaults.spec.ts +++ b/src/file/styles/defaults/document-defaults.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/styles/external-styles-factory.spec.ts b/src/file/styles/external-styles-factory.spec.ts index f410d867b3..3bd26e94b8 100644 --- a/src/file/styles/external-styles-factory.spec.ts +++ b/src/file/styles/external-styles-factory.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { beforeEach, describe, expect, it } from "vitest"; import { ExternalStylesFactory } from "./external-styles-factory"; diff --git a/src/file/styles/latent-styles/exceptions.spec.ts b/src/file/styles/latent-styles/exceptions.spec.ts index 0b38ea75dd..11ad15aa0f 100644 --- a/src/file/styles/latent-styles/exceptions.spec.ts +++ b/src/file/styles/latent-styles/exceptions.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/styles/latent-styles/latent-styles.spec.ts b/src/file/styles/latent-styles/latent-styles.spec.ts index 3364654ef4..f1deca8b54 100644 --- a/src/file/styles/latent-styles/latent-styles.spec.ts +++ b/src/file/styles/latent-styles/latent-styles.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/styles/sample/default-style.spec.ts b/src/file/styles/sample/default-style.spec.ts index 899dd4f47e..83b82db5a4 100644 --- a/src/file/styles/sample/default-style.spec.ts +++ b/src/file/styles/sample/default-style.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { DefaultStyle } from "./default-style"; diff --git a/src/file/styles/style/character-style.spec.ts b/src/file/styles/style/character-style.spec.ts index a91cd05f7a..601ee7e469 100644 --- a/src/file/styles/style/character-style.spec.ts +++ b/src/file/styles/style/character-style.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { EmphasisMarkType } from "@file/paragraph/run/emphasis-mark"; diff --git a/src/file/styles/style/components.spec.ts b/src/file/styles/style/components.spec.ts index 5ae8205e25..af21f5ec87 100644 --- a/src/file/styles/style/components.spec.ts +++ b/src/file/styles/style/components.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/styles/style/default-styles.spec.ts b/src/file/styles/style/default-styles.spec.ts index 5a3844a892..bdffda5f55 100644 --- a/src/file/styles/style/default-styles.spec.ts +++ b/src/file/styles/style/default-styles.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { EMPTY_OBJECT } from "@file/xml-components"; diff --git a/src/file/styles/style/paragraph-style.spec.ts b/src/file/styles/style/paragraph-style.spec.ts index 4ccac61b5a..4b4cbe8238 100644 --- a/src/file/styles/style/paragraph-style.spec.ts +++ b/src/file/styles/style/paragraph-style.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { AlignmentType, EmphasisMarkType, TabStopPosition } from "@file/paragraph"; diff --git a/src/file/styles/style/style.spec.ts b/src/file/styles/style/style.spec.ts index ea250bfe30..fd93a5789c 100644 --- a/src/file/styles/style/style.spec.ts +++ b/src/file/styles/style/style.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/styles/styles.spec.ts b/src/file/styles/styles.spec.ts index 4c74861909..e92ea1891b 100644 --- a/src/file/styles/styles.spec.ts +++ b/src/file/styles/styles.spec.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { EMPTY_OBJECT } from "@file/xml-components"; diff --git a/src/file/table-of-contents/table-of-contents.spec.ts b/src/file/table-of-contents/table-of-contents.spec.ts index bd55661a41..0d011446a9 100644 --- a/src/file/table-of-contents/table-of-contents.spec.ts +++ b/src/file/table-of-contents/table-of-contents.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/table/grid.spec.ts b/src/file/table/grid.spec.ts index f0dacac9c8..64e4501864 100644 --- a/src/file/table/grid.spec.ts +++ b/src/file/table/grid.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { EMPTY_OBJECT } from "@file/xml-components"; import { Formatter } from "@export/formatter"; diff --git a/src/file/table/table-cell/table-cell-properties.spec.ts b/src/file/table/table-cell/table-cell-properties.spec.ts index 4a26ed46c7..504dc2229e 100644 --- a/src/file/table/table-cell/table-cell-properties.spec.ts +++ b/src/file/table/table-cell/table-cell-properties.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { BorderStyle } from "@file/border"; diff --git a/src/file/table/table-cell/table-cell.spec.ts b/src/file/table/table-cell/table-cell.spec.ts index acd42d7a31..a453a30899 100644 --- a/src/file/table/table-cell/table-cell.spec.ts +++ b/src/file/table/table-cell/table-cell.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { BorderStyle } from "@file/border"; diff --git a/src/file/table/table-properties/table-borders.spec.ts b/src/file/table/table-properties/table-borders.spec.ts index cfb869cacf..7d391b07ee 100644 --- a/src/file/table/table-properties/table-borders.spec.ts +++ b/src/file/table/table-properties/table-borders.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { BorderStyle } from "@file/border"; diff --git a/src/file/table/table-properties/table-cell-margin.spec.ts b/src/file/table/table-properties/table-cell-margin.spec.ts index 97c6418bac..c4fa4239bf 100644 --- a/src/file/table/table-properties/table-cell-margin.spec.ts +++ b/src/file/table/table-properties/table-cell-margin.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { WidthType } from "../table-width"; diff --git a/src/file/table/table-properties/table-float-properties.spec.ts b/src/file/table/table-properties/table-float-properties.spec.ts index c64e1be446..f9db13d655 100644 --- a/src/file/table/table-properties/table-float-properties.spec.ts +++ b/src/file/table/table-properties/table-float-properties.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/table/table-properties/table-properties.spec.ts b/src/file/table/table-properties/table-properties.spec.ts index bf4832691f..2d0665182a 100644 --- a/src/file/table/table-properties/table-properties.spec.ts +++ b/src/file/table/table-properties/table-properties.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/table/table-row/table-row-properties.spec.ts b/src/file/table/table-row/table-row-properties.spec.ts index b9cde6078b..f96d39dca8 100644 --- a/src/file/table/table-row/table-row-properties.spec.ts +++ b/src/file/table/table-row/table-row-properties.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { HeightRule } from "@file/table/table-row/table-row-height"; diff --git a/src/file/table/table-row/table-row.spec.ts b/src/file/table/table-row/table-row.spec.ts index f8bf783fd8..d662e9073d 100644 --- a/src/file/table/table-row/table-row.spec.ts +++ b/src/file/table/table-row/table-row.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/table/table.spec.ts b/src/file/table/table.spec.ts index 53e823771b..f9eee74990 100644 --- a/src/file/table/table.spec.ts +++ b/src/file/table/table.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* tslint:disable:no-unused-expression */ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/track-revision/track-revision-components/deleted-page-number.spec.ts b/src/file/track-revision/track-revision-components/deleted-page-number.spec.ts index 274484ea02..d7cee45175 100644 --- a/src/file/track-revision/track-revision-components/deleted-page-number.spec.ts +++ b/src/file/track-revision/track-revision-components/deleted-page-number.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/track-revision/track-revision-components/deleted-text-run.spec.ts b/src/file/track-revision/track-revision-components/deleted-text-run.spec.ts index 0e445888d7..3c521df01c 100644 --- a/src/file/track-revision/track-revision-components/deleted-text-run.spec.ts +++ b/src/file/track-revision/track-revision-components/deleted-text-run.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { FootnoteReferenceRun } from "@file/footnotes"; diff --git a/src/file/track-revision/track-revision-components/deleted-text.spec.ts b/src/file/track-revision/track-revision-components/deleted-text.spec.ts index 7a4b859acf..ca34e1a4b9 100644 --- a/src/file/track-revision/track-revision-components/deleted-text.spec.ts +++ b/src/file/track-revision/track-revision-components/deleted-text.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/track-revision/track-revision-components/inserted-text-run.spec.ts b/src/file/track-revision/track-revision-components/inserted-text-run.spec.ts index ee5e2b957e..cc9e7436e6 100644 --- a/src/file/track-revision/track-revision-components/inserted-text-run.spec.ts +++ b/src/file/track-revision/track-revision-components/inserted-text-run.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/xml-components/attribute.spec.ts b/src/file/xml-components/attribute.spec.ts index a8962307ab..6bfe4e4c5a 100644 --- a/src/file/xml-components/attribute.spec.ts +++ b/src/file/xml-components/attribute.spec.ts @@ -1,4 +1,4 @@ -import { assert } from "chai"; +import { assert, describe, it } from "vitest"; import { Attributes } from "./"; diff --git a/src/file/xml-components/imported-xml-component.spec.ts b/src/file/xml-components/imported-xml-component.spec.ts index d9a14227c2..ebf61ad7b3 100644 --- a/src/file/xml-components/imported-xml-component.spec.ts +++ b/src/file/xml-components/imported-xml-component.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { beforeEach, describe, expect, it } from "vitest"; import { Element, xml2js } from "xml-js"; import { EMPTY_OBJECT } from "@file/xml-components"; diff --git a/src/file/xml-components/simple-elements.spec.ts b/src/file/xml-components/simple-elements.spec.ts index 049389a353..de6bc55a85 100644 --- a/src/file/xml-components/simple-elements.spec.ts +++ b/src/file/xml-components/simple-elements.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; diff --git a/src/file/xml-components/xml-component.spec.ts b/src/file/xml-components/xml-component.spec.ts index 414059ee61..c5b83d9445 100644 --- a/src/file/xml-components/xml-component.spec.ts +++ b/src/file/xml-components/xml-component.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Formatter } from "@export/formatter"; import { Attributes, BaseXmlComponent, XmlComponent } from "./"; diff --git a/src/index.spec.ts b/src/index.spec.ts index 480dbf1dc1..86f1feb521 100644 --- a/src/index.spec.ts +++ b/src/index.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { Document } from "./index"; diff --git a/src/patcher/content-types-manager.spec.ts b/src/patcher/content-types-manager.spec.ts index 0dd8eb38c4..5bcebe8c9d 100644 --- a/src/patcher/content-types-manager.spec.ts +++ b/src/patcher/content-types-manager.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { appendContentType } from "./content-types-manager"; describe("content-types-manager", () => { diff --git a/src/patcher/from-docx.spec.ts b/src/patcher/from-docx.spec.ts index c9d00207ca..ee1fbf0281 100644 --- a/src/patcher/from-docx.spec.ts +++ b/src/patcher/from-docx.spec.ts @@ -1,3 +1,4 @@ +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import * as chai from "chai"; import * as sinon from "sinon"; import JSZip from "jszip"; @@ -8,7 +9,6 @@ import { ExternalHyperlink, ImageRun, Paragraph, TextRun } from "@file/paragraph import { patchDocument, PatchType } from "./from-docx"; chai.use(chaiAsPromised); -const { expect } = chai; const MOCK_XML = ` @@ -220,7 +220,7 @@ describe("from-docx", () => { }); afterEach(() => { - (JSZip.loadAsync as unknown as sinon.SinonStub).restore(); + vi.restoreAllMocks(); }); it("should patch the document", async () => { @@ -306,7 +306,7 @@ describe("from-docx", () => { }); afterEach(() => { - (JSZip.loadAsync as unknown as sinon.SinonStub).restore(); + vi.restoreAllMocks(); }); it("should use the relationships file rather than create one", async () => { @@ -350,7 +350,7 @@ describe("from-docx", () => { }); afterEach(() => { - (JSZip.loadAsync as unknown as sinon.SinonStub).restore(); + vi.restoreAllMocks(); }); it("should throw an error if the content types is not found", () => @@ -388,7 +388,7 @@ describe("from-docx", () => { }); afterEach(() => { - (JSZip.loadAsync as unknown as sinon.SinonStub).restore(); + vi.restoreAllMocks(); }); it("should throw an error if the content types is not found", () => diff --git a/src/patcher/paragraph-split-inject.spec.ts b/src/patcher/paragraph-split-inject.spec.ts index 7b207ba82b..6d58c2f0f1 100644 --- a/src/patcher/paragraph-split-inject.spec.ts +++ b/src/patcher/paragraph-split-inject.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { findRunElementIndexWithToken, splitRunElement } from "./paragraph-split-inject"; diff --git a/src/patcher/paragraph-token-replacer.spec.ts b/src/patcher/paragraph-token-replacer.spec.ts index fff9d954eb..62ce1b7622 100644 --- a/src/patcher/paragraph-token-replacer.spec.ts +++ b/src/patcher/paragraph-token-replacer.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { replaceTokenInParagraphElement } from "./paragraph-token-replacer"; diff --git a/src/patcher/relationship-manager.spec.ts b/src/patcher/relationship-manager.spec.ts index 4d22e7df8b..32bf414423 100644 --- a/src/patcher/relationship-manager.spec.ts +++ b/src/patcher/relationship-manager.spec.ts @@ -1,5 +1,5 @@ import { TargetModeType } from "@file/relationships/relationship/relationship"; -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { appendRelationship, getNextRelationshipIndex } from "./relationship-manager"; diff --git a/src/patcher/replacer.spec.ts b/src/patcher/replacer.spec.ts index 8b15bd1fa9..71f6b3126f 100644 --- a/src/patcher/replacer.spec.ts +++ b/src/patcher/replacer.spec.ts @@ -2,7 +2,7 @@ import { IViewWrapper } from "@file/document-wrapper"; import { File } from "@file/file"; import { Paragraph, TextRun } from "@file/paragraph"; import { IContext } from "@file/xml-components"; -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import * as sinon from "sinon"; import { PatchType } from "./from-docx"; diff --git a/src/patcher/run-renderer.spec.ts b/src/patcher/run-renderer.spec.ts index 949f4a7635..5771dc0233 100644 --- a/src/patcher/run-renderer.spec.ts +++ b/src/patcher/run-renderer.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { renderParagraphNode } from "./run-renderer"; describe("run-renderer", () => { diff --git a/src/patcher/traverser.spec.ts b/src/patcher/traverser.spec.ts index d961bae0bb..0d68a0d00d 100644 --- a/src/patcher/traverser.spec.ts +++ b/src/patcher/traverser.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { findLocationOfText } from "./traverser"; diff --git a/src/patcher/util.spec.ts b/src/patcher/util.spec.ts index c303b4ffe6..7a8422e5b5 100644 --- a/src/patcher/util.spec.ts +++ b/src/patcher/util.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { createTextElementContents, getFirstLevelElements, patchSpaceAttribute, toJson } from "./util"; diff --git a/src/util/convenience-functions.spec.ts b/src/util/convenience-functions.spec.ts index 4bca649b6b..533bae4f09 100644 --- a/src/util/convenience-functions.spec.ts +++ b/src/util/convenience-functions.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { convertInchesToTwip, convertMillimetersToTwip, uniqueId, uniqueNumericIdCreator } from "./convenience-functions"; diff --git a/src/util/values.spec.ts b/src/util/values.spec.ts index 32df1a74b2..0506f9589d 100644 --- a/src/util/values.spec.ts +++ b/src/util/values.spec.ts @@ -1,4 +1,4 @@ -import { expect } from "chai"; +import { describe, expect, it } from "vitest"; import { dateTimeValue, hexColorValue, diff --git a/vite.config.ts b/vite.config.ts index e71d3914d1..db9139dd76 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,4 +1,4 @@ -import { defineConfig } from "vite"; +import { defineConfig } from "vitest/config"; import { resolve } from "path"; import tsconfigPaths from "vite-tsconfig-paths"; import dts from "vite-plugin-dts";