Skip to content

Commit

Permalink
chore: remove jest dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
filzrev committed Oct 19, 2024
1 parent 6b52636 commit 53be532
Show file tree
Hide file tree
Showing 4 changed files with 4,590 additions and 15,102 deletions.
15 changes: 0 additions & 15 deletions templates/jest.config.js

This file was deleted.

30 changes: 16 additions & 14 deletions templates/modern/src/helper.test.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

import test from 'node:test'
import assert from 'node:assert'
import { breakWord, isSameURL } from './helper'

test('break text', () => {
expect(breakWord('Other APIs')).toEqual(['Other APIs'])
expect(breakWord('System.CodeDom')).toEqual(['System.', 'Code', 'Dom'])
expect(breakWord('System.Collections.Dictionary<string, object>')).toEqual(['System.', 'Collections.', 'Dictionary<', 'string,', ' object>'])
expect(breakWord('https://github.com/dotnet/docfx')).toEqual(['https://github.', 'com/', 'dotnet/', 'docfx'])
assert.deepStrictEqual(breakWord('Other APIs'), ['Other APIs'])
assert.deepStrictEqual(breakWord('System.CodeDom'), ['System.', 'Code', 'Dom'])
assert.deepStrictEqual(breakWord('System.Collections.Dictionary<string, object>'), ['System.', 'Collections.', 'Dictionary<', 'string,', ' object>'])
assert.deepStrictEqual(breakWord('https://github.com/dotnet/docfx'), ['https://github.', 'com/', 'dotnet/', 'docfx'])
})

test('is same URL', () => {
expect(isSameURL({ pathname: '/' }, { pathname: '/' })).toBeTruthy()
expect(isSameURL({ pathname: '/index.html' }, { pathname: '/' })).toBeTruthy()
expect(isSameURL({ pathname: '/a/index.html' }, { pathname: '/a' })).toBeTruthy()
expect(isSameURL({ pathname: '/a/index.html' }, { pathname: '/a/' })).toBeTruthy()
expect(isSameURL({ pathname: '/a' }, { pathname: '/a/' })).toBeTruthy()
expect(isSameURL({ pathname: '/a/foo.html' }, { pathname: '/a/foo' })).toBeTruthy()
expect(isSameURL({ pathname: '/a/foo/' }, { pathname: '/a/foo' })).toBeTruthy()
expect(isSameURL({ pathname: '/a/foo/index.html' }, { pathname: '/a/foo' })).toBeTruthy()
expect(isSameURL({ pathname: '/a/index.html' }, { pathname: '/A/Index.html' })).toBeTruthy()
assert.ok(isSameURL({ pathname: '/' }, { pathname: '/' }))
assert.ok(isSameURL({ pathname: '/index.html' }, { pathname: '/' }))
assert.ok(isSameURL({ pathname: '/a/index.html' }, { pathname: '/a' }))
assert.ok(isSameURL({ pathname: '/a/index.html' }, { pathname: '/a/' }))
assert.ok(isSameURL({ pathname: '/a' }, { pathname: '/a/' }))
assert.ok(isSameURL({ pathname: '/a/foo.html' }, { pathname: '/a/foo' }))
assert.ok(isSameURL({ pathname: '/a/foo/' }, { pathname: '/a/foo' }))
assert.ok(isSameURL({ pathname: '/a/foo/index.html' }, { pathname: '/a/foo' }))
assert.ok(isSameURL({ pathname: '/a/index.html' }, { pathname: '/A/Index.html' }))

expect(isSameURL({ pathname: '/a/foo/index.html' }, { pathname: '/a/bar' })).toBeFalsy()
assert.ok(!isSameURL({ pathname: '/a/foo/index.html' }, { pathname: '/a/bar' }))
})
Loading

0 comments on commit 53be532

Please sign in to comment.