Skip to content

Commit

Permalink
Use CommonJS for test files, matching package
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrobertlloyd committed Dec 10, 2023
1 parent e5da3c9 commit 504a2b7
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 31 deletions.
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# JavaScript (formatted with Standard)
**/*.js
**/*.mjs
6 changes: 3 additions & 3 deletions test/lib/filters/date.mjs → test/lib/filters/date.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { strict as assert } from 'node:assert'
import { describe, it } from 'node:test'
import date from '../../../lib/filters/date.js'
const assert = require('assert/strict')
const { describe, it } = require('node:test')
const date = require('../../../lib/filters/date.js')

describe('Date filter', () => {
it('Formats a date using tokens', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { strict as assert } from 'node:assert'
import { describe, it } from 'node:test'
import itemsFromCollection from '../../../lib/filters/items-from-collection.js'
const assert = require('assert/strict')
const { describe, it } = require('node:test')
const itemsFromCollection = require('../../../lib/filters/items-from-collection.js')

const collectionData = [{
data: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { strict as assert } from 'node:assert'
import { describe, it } from 'node:test'
import itemsFromNavigation from '../../../lib/filters/items-from-navigation.js'
const assert = require('assert/strict')
const { describe, it } = require('node:test')
const itemsFromNavigation = require('../../../lib/filters/items-from-navigation.js')

const eleventyNavigationBreadcrumb = [{
key: 'Home',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { strict as assert } from 'node:assert'
import { describe, it } from 'node:test'
import markdown from '../../../lib/filters/markdown.js'
const assert = require('assert/strict')
const { describe, it } = require('node:test')
const markdown = require('../../../lib/filters/markdown.js')

describe('markdown filter', () => {
it('Converts Markdown string to HTML', t => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { strict as assert } from 'node:assert'
import { describe, it } from 'node:test'
import noOrphans from '../../../lib/filters/no-orphans.js'
const assert = require('assert/strict')
const { describe, it } = require('node:test')
const noOrphans = require('../../../lib/filters/no-orphans.js')

describe('noOrphans filter', () => {
it('Inserts non-breaking space between last two words of a string', () => {
Expand Down
6 changes: 3 additions & 3 deletions test/lib/filters/pretty.mjs → test/lib/filters/pretty.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { strict as assert } from 'node:assert'
import { describe, it } from 'node:test'
import pretty from '../../../lib/filters/pretty.js'
const assert = require('assert/strict')
const { describe, it } = require('node:test')
const pretty = require('../../../lib/filters/pretty.js')

describe('pretty filter', () => {
it('Removes index.html from a string', () => {
Expand Down
6 changes: 3 additions & 3 deletions test/lib/filters/smart.mjs → test/lib/filters/smart.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { strict as assert } from 'node:assert'
import { describe, it } from 'node:test'
import smart from '../../../lib/filters/smart.js'
const assert = require('assert/strict')
const { describe, it } = require('node:test')
const smart = require('../../../lib/filters/smart.js')

describe('smart filter', () => {
it('Converts plain ASCII quotes into ‘smart’ typographic quotes', t => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { strict as assert } from 'node:assert'
import { describe, it } from 'node:test'
import tokenize from '../../../lib/filters/tokenize.js'
const assert = require('assert/strict')
const { describe, it } = require('node:test')
const tokenize = require('../../../lib/filters/tokenize.js')

describe('tokenize filter', () => {
it('Reduces size of a string by removing duplicate and common words', () => {
Expand Down
6 changes: 3 additions & 3 deletions test/lib/markdown-it.mjs → test/lib/markdown-it.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { strict as assert } from 'node:assert'
import { describe, it } from 'node:test'
import md from '../../lib/markdown-it.js'
const assert = require('assert/strict')
const { describe, it } = require('node:test')
const md = require('../../lib/markdown-it.js')

describe('markdown-it', () => {
it('Returns configured markdown-it parser', () => {
Expand Down
6 changes: 3 additions & 3 deletions test/lib/utils.mjs → test/lib/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { strict as assert } from 'node:assert'
import { describe, it } from 'node:test'
import { ensureSlash, normalise } from '../../lib/utils.js'
const assert = require('assert/strict')
const { describe, it } = require('node:test')
const { ensureSlash, normalise } = require('../../lib/utils.js')

describe('Utility', () => {
it('Ensures string ends with a slash', () => {
Expand Down

0 comments on commit 504a2b7

Please sign in to comment.