Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Do not export the declaration of window.OC #667

Merged
merged 1 commit into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions __tests__/fileAction.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import { getFileActions, registerFileAction, FileAction } from '../lib/fileAction'
import logger from '../lib/utils/logger';

declare global {
interface Window {
OC: any;
_nc_fileactions: FileAction[] | undefined;
}
}

describe('FileActions init', () => {

beforeEach(() => {
Expand Down
6 changes: 0 additions & 6 deletions __tests__/humanFileSize.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import { formatFileSize } from '../lib/humanfilesize'

declare global {
interface Window {
OC: any;
}
}

describe('humanFileSize', () => {
describe('formatFileSize', () => {
it('renders file sizes with the correct unit', function() {
Expand Down
7 changes: 0 additions & 7 deletions __tests__/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ import { FileType as FileTypeSource } from '../lib/files/fileType'
import { Entry, NewFileMenu } from '../lib/newFileMenu';
import { FileAction, registerFileAction, getFileActions } from '../lib/fileAction'

declare global {
interface Window {
OC: any;
_nc_newfilemenu: NewFileMenu | undefined;
}
}

describe('Exports checks', () => {
test('formatFileSize', () => {
expect(formatFileSize).toBeTruthy()
Expand Down
7 changes: 0 additions & 7 deletions __tests__/newFileMenu.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import { NewFileMenu, getNewFileMenu, type Entry } from '../lib/newFileMenu'
import logger from '../lib/utils/logger';

declare global {
interface Window {
OC: any;
_nc_newfilemenu: NewFileMenu | undefined;
}
}

describe('NewFileMenu init', () => {
test('Initializing NewFileMenu', () => {
logger.debug = jest.fn()
Expand Down
12 changes: 6 additions & 6 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ module.exports = {
coveragePathIgnorePatterns: ['lib/utils/logger.ts'],
testEnvironment: 'jsdom',
preset: 'ts-jest/presets/js-with-ts',
globals: {
'ts-jest': {
tsconfig: '__tests__/tsconfig.json',
},
},
transformIgnorePatterns: [
'node_modules/(?!(abcde|fghij)/)',
'node_modules',
],
transform: {
'^.+\\.tsx?$': ['ts-jest', {
tsconfig: '__tests__/tsconfig.json',
}]
},
}
8 changes: 0 additions & 8 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ export { Node } from './files/node'
export { Permission, parseWebdavPermissions } from './permissions'
export { FileAction, registerFileAction, getFileActions } from './fileAction'

declare global {
interface Window {
OC: any;
_nc_newfilemenu: NewFileMenu | undefined;
_nc_fileactions: FileAction[] | undefined;
}
}

/**
* Add a new menu entry to the upload manager menu
*/
Expand Down
Loading
Loading