Skip to content

Commit

Permalink
change resolving
Browse files Browse the repository at this point in the history
  • Loading branch information
KingSora committed Jul 31, 2024
1 parent 3ba710a commit 61f11e9
Show file tree
Hide file tree
Showing 20 changed files with 21 additions and 41 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Component, ViewChild } from '@angular/core';
import { TestBed } from '@angular/core/testing';
import { OverlayScrollbars } from 'overlayscrollbars';
import type { ComponentFixture } from '@angular/core/testing';
import type { EventListenerArgs } from 'overlayscrollbars';
import {
OverlayScrollbarsComponent,
OverlayScrollbarsDirective,
OverlayscrollbarsModule,
} from '~/public-api';
import type { ComponentFixture } from '@angular/core/testing';
import type { EventListenerArgs } from 'overlayscrollbars';
} from '../src/public-api';

@Component({
template: `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { describe, test, afterEach, expect, vitest, vi } from 'vitest';
import { render, screen, cleanup } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { OverlayScrollbars } from 'overlayscrollbars';
import { OverlayScrollbarsComponent } from '~/overlayscrollbars-react';
import type { RefObject } from 'react';
import type { OverlayScrollbarsComponentRef } from '~/overlayscrollbars-react';
import type { OverlayScrollbarsComponentRef } from '../src/overlayscrollbars-react';
import { OverlayScrollbarsComponent } from '../src/overlayscrollbars-react';

vi.useFakeTimers({
toFake: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, test, afterEach, expect, vi } from 'vitest';
import { render, cleanup } from '@testing-library/react';
import { OverlayScrollbarsComponent } from '~/overlayscrollbars-react';
import { OverlayScrollbarsComponent } from '../../src/overlayscrollbars-react';

const getComputedStyleOriginal = window.getComputedStyle;
vi.stubGlobal(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { describe, test, afterEach, expect } from 'vitest';
import { render, screen, cleanup } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { OverlayScrollbars } from 'overlayscrollbars';
import { useOverlayScrollbars } from '~/overlayscrollbars-react';
import { useOverlayScrollbars } from '../src/overlayscrollbars-react';

describe('useOverlayScrollbars', () => {
afterEach(() => cleanup());
Expand Down
4 changes: 0 additions & 4 deletions packages/overlayscrollbars-react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
"module": "ES2015",
"moduleResolution": "node",
"jsx": "react-jsx",
"baseUrl": ".",
"paths": {
"~/*": ["./src/*"]
},
"types": ["jest", "@testing-library/jest-dom"]
}
}
6 changes: 1 addition & 5 deletions packages/overlayscrollbars-react/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { resolve } from 'node:path';
import { defineConfig } from 'vite';
import { esbuildResolve } from 'rollup-plugin-esbuild-resolve';
import react from '@vitejs/plugin-react';
import rollupPluginPackageJson from '@~local/rollup/plugin/packageJson';
import rollupPluginCopy from '@~local/rollup/plugin/copy';
Expand Down Expand Up @@ -92,8 +91,5 @@ export default defineConfig({
],
},
},
plugins: [
esbuildResolve(),
react(process.env.VITEST ? { jsxRuntime: 'automatic' } : { jsxRuntime: 'classic' }),
],
plugins: [react(process.env.VITEST ? { jsxRuntime: 'automatic' } : { jsxRuntime: 'classic' })],
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { createSignal, createEffect } from 'solid-js';
import { render, screen, cleanup, fireEvent } from '@solidjs/testing-library';
import userEvent from '@testing-library/user-event';
import { OverlayScrollbars } from 'overlayscrollbars';
import { OverlayScrollbarsComponent } from '~/overlayscrollbars-solid';
import type { OverlayScrollbarsComponentRef } from '~/overlayscrollbars-solid';
import type { OverlayScrollbarsComponentRef } from '../src/overlayscrollbars-solid';
import { OverlayScrollbarsComponent } from '../src/overlayscrollbars-solid';

vi.useFakeTimers({
toFake: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, test, afterEach, expect, vi } from 'vitest';
import { render, cleanup } from '@solidjs/testing-library';
import { OverlayScrollbarsComponent } from '~/overlayscrollbars-solid';
import { OverlayScrollbarsComponent } from '../../src/overlayscrollbars-solid';

const getComputedStyleOriginal = window.getComputedStyle;
vi.stubGlobal(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { createStore } from 'solid-js/store';
import { render, screen, cleanup } from '@solidjs/testing-library';
import userEvent from '@testing-library/user-event';
import { OverlayScrollbars } from 'overlayscrollbars';
import { createOverlayScrollbars } from '~/overlayscrollbars-solid';
import type { PartialOptions, EventListeners } from 'overlayscrollbars';
import { createOverlayScrollbars } from '../src/overlayscrollbars-solid';

describe('OverlayScrollbarsComponent', () => {
afterEach(() => cleanup());
Expand Down
5 changes: 1 addition & 4 deletions packages/overlayscrollbars-solid/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
"esModuleInterop": true,
"jsx": "preserve",
"jsxImportSource": "solid-js",
"types": ["vite/client", "jest", "@testing-library/jest-dom"],
"isolatedModules": true,
"paths": {
"~/*": ["./src/*"]
}
"types": ["vite/client", "jest", "@testing-library/jest-dom"]
}
}
2 changes: 0 additions & 2 deletions packages/overlayscrollbars-solid/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { resolve } from 'node:path';
import ts from 'typescript';
import { defineConfig } from 'vite';
import { esbuildResolve } from 'rollup-plugin-esbuild-resolve';
import solidPlugin from 'vite-plugin-solid';
import rollupPluginPackageJson from '@~local/rollup/plugin/packageJson';
import rollupPluginCopy from '@~local/rollup/plugin/copy';
Expand Down Expand Up @@ -92,7 +91,6 @@ export default defineConfig({
},
},
plugins: [
esbuildResolve(),
solidPlugin({
solid: {
generate: 'dom',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { describe, test, expect, afterEach, vitest, vi } from 'vitest';
import { cleanup, render, screen, fireEvent } from '@testing-library/svelte';
import userEvent from '@testing-library/user-event';
import { OverlayScrollbars } from 'overlayscrollbars';
import { OverlayScrollbarsComponent } from '~/overlayscrollbars-svelte';
import type { Ref } from '~/OverlayScrollbarsComponent.types';
import type { Ref } from '../src/OverlayScrollbarsComponent.types';
import { OverlayScrollbarsComponent } from '../src/overlayscrollbars-svelte';
import Test from './Test.svelte';

vi.useFakeTimers({
Expand Down
2 changes: 1 addition & 1 deletion packages/overlayscrollbars-svelte/test/Test.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { afterUpdate, onMount } from 'svelte';
import { OverlayScrollbarsComponent } from '~/overlayscrollbars-svelte';
import { OverlayScrollbarsComponent } from '../src/overlayscrollbars-svelte';
let children = 1;
let ref: any;
Expand Down
2 changes: 1 addition & 1 deletion packages/overlayscrollbars-svelte/test/body/Test.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { OverlayScrollbarsComponent } from '~/overlayscrollbars-svelte';
import { OverlayScrollbarsComponent } from '../../src/overlayscrollbars-svelte';
export let element: any = 'div';
</script>

Expand Down
3 changes: 1 addition & 2 deletions packages/overlayscrollbars-svelte/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { resolve } from 'path';
import { defineConfig } from 'vitest/config';
import { esbuildResolve } from 'rollup-plugin-esbuild-resolve';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import rollupPluginPackageJson from '@~local/rollup/plugin/packageJson';
import rollupPluginCopy from '@~local/rollup/plugin/copy';
Expand Down Expand Up @@ -93,5 +92,5 @@ export default defineConfig({
],
},
},
plugins: [esbuildResolve(), svelte(process.env.VITEST ? { hot: false } : {})],
plugins: [svelte(process.env.VITEST ? { hot: false } : {})],
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { describe, test, afterEach, expect, vitest, vi } from 'vitest';
import { OverlayScrollbars } from 'overlayscrollbars';
import { fireEvent, render, screen, cleanup } from '@testing-library/vue';
import userEvent from '@testing-library/user-event';
import { OverlayScrollbarsComponent } from '~/overlayscrollbars-vue';
import { OverlayScrollbarsComponent } from '../src/overlayscrollbars-vue';

vi.useFakeTimers({
toFake: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, test, afterEach, expect, vi } from 'vitest';
import { render, cleanup } from '@testing-library/vue';
import { OverlayScrollbarsComponent } from '~/overlayscrollbars-vue';
import { OverlayScrollbarsComponent } from '../../src/overlayscrollbars-vue';

const getComputedStyleOriginal = window.getComputedStyle;
vi.stubGlobal(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { describe, test, afterEach, expect, vitest } from 'vitest';
import { render, screen, cleanup } from '@testing-library/vue';
import userEvent from '@testing-library/user-event';
import { OverlayScrollbars } from 'overlayscrollbars';
import { useOverlayScrollbars } from '~/overlayscrollbars-vue';
import type { PartialOptions, EventListeners } from 'overlayscrollbars';
import { useOverlayScrollbars } from '../src/overlayscrollbars-vue';

describe('useOverlayScrollbars', () => {
afterEach(() => {
Expand Down
4 changes: 0 additions & 4 deletions packages/overlayscrollbars-vue/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"extends": "@vue/tsconfig/tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/*": ["./src/*"]
},
"jsx": "preserve",
"types": ["jest", "@testing-library/jest-dom"]
}
Expand Down
2 changes: 0 additions & 2 deletions packages/overlayscrollbars-vue/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { resolve } from 'node:path';
import { defineConfig } from 'vite';
import { esbuildResolve } from 'rollup-plugin-esbuild-resolve';
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
import rollupPluginPackageJson from '@~local/rollup/plugin/packageJson';
Expand Down Expand Up @@ -95,7 +94,6 @@ export default defineConfig({
},
},
plugins: [
esbuildResolve(),
vue(),
vueJsx(), // used for testing
],
Expand Down

0 comments on commit 61f11e9

Please sign in to comment.