Skip to content

Commit 0675603

Browse files
committed
fixed tests
1 parent 4e3d29c commit 0675603

7 files changed

Lines changed: 12 additions & 23 deletions

File tree

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default {
1313
transformIgnorePatterns: ['/node_modules/(?!lit-html).+\\.js'],
1414
setupFilesAfterEnv: ['./test/helpers/setup.ts'],
1515
testMatch: ['**/?(*.)+(spec|test).[tj]s?(x)'],
16-
roots: ['<rootDir>/src', '<rootDir>/test', '<rootDir>/__mocks__'],
16+
roots: ['<rootDir>/src', '<rootDir>/test'],
1717
// For some reason Jest is not measuring coverage without the below option.
1818
// Unfortunately, despite `!(.test)`, it still measures coverage of test files as well:
1919
// forceCoverageMatch: ['./src/**/*!(.test).ts'],

test/helpers/jest.setup.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

test/helpers/setup.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import '@testing-library/jest-dom'
2+
import fetchMock from 'jest-fetch-mock'
3+
import { TextEncoder, TextDecoder } from 'util'
4+
5+
fetchMock.enableMocks()
6+
7+
global.TextEncoder = TextEncoder
8+
global.TextDecoder = TextDecoder

test/unit/outline/manager.test.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
/* eslint-env jest */
2-
3-
import { TextEncoder, TextDecoder } from 'util'
4-
5-
import OutlineManager from './manager'
6-
2+
import OutlineManager from '../../../src/outline/manager'
73
import { lit, NamedNode, sym, blankNode } from 'rdflib'
84
import { findByText, getByText } from '@testing-library/dom'
9-
global.TextEncoder = TextEncoder as any
10-
global.TextDecoder = TextDecoder as any
115

126
const MockPane = {
137
render: (subject: NamedNode) => {

test/unit/outline/propertyViews.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
/* eslint-env jest */
2-
3-
import { TextEncoder, TextDecoder } from 'util'
4-
52
import { sym } from 'rdflib'
6-
import { propertyViews } from './propertyViews'
7-
global.TextEncoder = TextEncoder as any
8-
global.TextDecoder = TextDecoder as any
3+
import { propertyViews } from '../../../src/outline/propertyViews'
94

105
describe('property views', () => {
116
it.each([

test/unit/__snapshots__/trustedApplications.test.ts.snap renamed to test/unit/trustedApplications/__snapshots__/trustedApplications.test.ts.snap

File renamed without changes.

test/unit/trustedApplications/trustedApplications.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
/* eslint-env jest */
2-
import { TextEncoder, TextDecoder } from 'util'
3-
42
import * as $rdf from 'rdflib'
53
import solidNamespace from 'solid-namespace'
6-
import { generateRandomString, getStatementsToDelete, getStatementsToAdd } from './trustedApplications.utils'
7-
global.TextEncoder = TextEncoder as any
8-
global.TextDecoder = TextDecoder as any
4+
import { generateRandomString, getStatementsToDelete, getStatementsToAdd } from '../../../src/trustedApplications/trustedApplications.utils'
95

106
const ns = solidNamespace($rdf)
117

0 commit comments

Comments
 (0)