From 433a5b19943bc18099c258640eac085eace1c845 Mon Sep 17 00:00:00 2001 From: Bryn Ryans Date: Thu, 23 Nov 2023 16:31:27 +0000 Subject: [PATCH] fix broken tests --- react/javascript/demo-core-sdk/jest.config.js | 5 ++++- react/javascript/demo-embeds/jest.config.js | 5 ++++- react/javascript/demo-extension-sdk/jest.config.js | 5 ++++- react/javascript/demo-external-api/jest.config.js | 5 ++++- react/javascript/file-download/jest.config.js | 5 ++++- react/javascript/file-upload/jest.config.js | 5 ++++- react/javascript/helloworld-js/jest.config.js | 5 ++++- react/javascript/map-iframe/jest.config.js | 5 ++++- react/javascript/tile-sdk/jest.config.js | 5 ++++- react/javascript/tile-visualization/jest.config.js | 5 ++++- .../javascript/tile-visualization/src/TileExtension.spec.js | 3 ++- 11 files changed, 42 insertions(+), 11 deletions(-) diff --git a/react/javascript/demo-core-sdk/jest.config.js b/react/javascript/demo-core-sdk/jest.config.js index 2c7fa92..2a3383c 100644 --- a/react/javascript/demo-core-sdk/jest.config.js +++ b/react/javascript/demo-core-sdk/jest.config.js @@ -24,10 +24,13 @@ */ +const transformIgnorePatterns = + 'node_modules/@looker/extension-sdk-react|node_modules/@looker/extension-sdk|node_modules/@looker/sdk' + module.exports = { automock: false, moduleDirectories: ['./node_modules'], - transformIgnorePatterns: [], + transformIgnorePatterns: [transformIgnorePatterns], moduleFileExtensions: ['js', 'jsx', 'json'], restoreMocks: true, testPathIgnorePatterns: [], diff --git a/react/javascript/demo-embeds/jest.config.js b/react/javascript/demo-embeds/jest.config.js index 15e24c8..b5ba1d7 100644 --- a/react/javascript/demo-embeds/jest.config.js +++ b/react/javascript/demo-embeds/jest.config.js @@ -24,12 +24,15 @@ */ +const transformIgnorePatterns = + 'node_modules/@looker/extension-sdk-react|node_modules/@looker/extension-sdk|node_modules/@looker/sdk' + module.exports = { automock: false, moduleDirectories: ['./node_modules'], moduleFileExtensions: ['js', 'jsx', 'json'], restoreMocks: true, - transformIgnorePatterns: [], + transformIgnorePatterns: [transformIgnorePatterns], testPathIgnorePatterns: [], globals: {}, } diff --git a/react/javascript/demo-extension-sdk/jest.config.js b/react/javascript/demo-extension-sdk/jest.config.js index 324eec1..725157a 100644 --- a/react/javascript/demo-extension-sdk/jest.config.js +++ b/react/javascript/demo-extension-sdk/jest.config.js @@ -24,11 +24,14 @@ */ +const transformIgnorePatterns = + 'node_modules/@looker/extension-sdk-react|node_modules/@looker/extension-sdk|node_modules/@looker/sdk' + module.exports = { automock: false, moduleDirectories: ['./node_modules'], moduleFileExtensions: ['js', 'jsx', 'json'], - transformIgnorePatterns: [], + transformIgnorePatterns: [transformIgnorePatterns], restoreMocks: true, testPathIgnorePatterns: [], globals: {}, diff --git a/react/javascript/demo-external-api/jest.config.js b/react/javascript/demo-external-api/jest.config.js index 15e24c8..b5ba1d7 100644 --- a/react/javascript/demo-external-api/jest.config.js +++ b/react/javascript/demo-external-api/jest.config.js @@ -24,12 +24,15 @@ */ +const transformIgnorePatterns = + 'node_modules/@looker/extension-sdk-react|node_modules/@looker/extension-sdk|node_modules/@looker/sdk' + module.exports = { automock: false, moduleDirectories: ['./node_modules'], moduleFileExtensions: ['js', 'jsx', 'json'], restoreMocks: true, - transformIgnorePatterns: [], + transformIgnorePatterns: [transformIgnorePatterns], testPathIgnorePatterns: [], globals: {}, } diff --git a/react/javascript/file-download/jest.config.js b/react/javascript/file-download/jest.config.js index 2c7fa92..2a3383c 100644 --- a/react/javascript/file-download/jest.config.js +++ b/react/javascript/file-download/jest.config.js @@ -24,10 +24,13 @@ */ +const transformIgnorePatterns = + 'node_modules/@looker/extension-sdk-react|node_modules/@looker/extension-sdk|node_modules/@looker/sdk' + module.exports = { automock: false, moduleDirectories: ['./node_modules'], - transformIgnorePatterns: [], + transformIgnorePatterns: [transformIgnorePatterns], moduleFileExtensions: ['js', 'jsx', 'json'], restoreMocks: true, testPathIgnorePatterns: [], diff --git a/react/javascript/file-upload/jest.config.js b/react/javascript/file-upload/jest.config.js index 2c7fa92..2a3383c 100644 --- a/react/javascript/file-upload/jest.config.js +++ b/react/javascript/file-upload/jest.config.js @@ -24,10 +24,13 @@ */ +const transformIgnorePatterns = + 'node_modules/@looker/extension-sdk-react|node_modules/@looker/extension-sdk|node_modules/@looker/sdk' + module.exports = { automock: false, moduleDirectories: ['./node_modules'], - transformIgnorePatterns: [], + transformIgnorePatterns: [transformIgnorePatterns], moduleFileExtensions: ['js', 'jsx', 'json'], restoreMocks: true, testPathIgnorePatterns: [], diff --git a/react/javascript/helloworld-js/jest.config.js b/react/javascript/helloworld-js/jest.config.js index 2c7fa92..2a3383c 100644 --- a/react/javascript/helloworld-js/jest.config.js +++ b/react/javascript/helloworld-js/jest.config.js @@ -24,10 +24,13 @@ */ +const transformIgnorePatterns = + 'node_modules/@looker/extension-sdk-react|node_modules/@looker/extension-sdk|node_modules/@looker/sdk' + module.exports = { automock: false, moduleDirectories: ['./node_modules'], - transformIgnorePatterns: [], + transformIgnorePatterns: [transformIgnorePatterns], moduleFileExtensions: ['js', 'jsx', 'json'], restoreMocks: true, testPathIgnorePatterns: [], diff --git a/react/javascript/map-iframe/jest.config.js b/react/javascript/map-iframe/jest.config.js index 2c7fa92..2a3383c 100644 --- a/react/javascript/map-iframe/jest.config.js +++ b/react/javascript/map-iframe/jest.config.js @@ -24,10 +24,13 @@ */ +const transformIgnorePatterns = + 'node_modules/@looker/extension-sdk-react|node_modules/@looker/extension-sdk|node_modules/@looker/sdk' + module.exports = { automock: false, moduleDirectories: ['./node_modules'], - transformIgnorePatterns: [], + transformIgnorePatterns: [transformIgnorePatterns], moduleFileExtensions: ['js', 'jsx', 'json'], restoreMocks: true, testPathIgnorePatterns: [], diff --git a/react/javascript/tile-sdk/jest.config.js b/react/javascript/tile-sdk/jest.config.js index 1f31bd0..9e81c50 100644 --- a/react/javascript/tile-sdk/jest.config.js +++ b/react/javascript/tile-sdk/jest.config.js @@ -24,10 +24,13 @@ */ +const transformIgnorePatterns = + 'node_modules/@looker/extension-sdk-react|node_modules/@looker/extension-sdk|node_modules/@looker/sdk' + module.exports = { automock: false, moduleDirectories: ['./node_modules'], - transformIgnorePatterns: [], + transformIgnorePatterns: [transformIgnorePatterns], moduleFileExtensions: ['js', 'jsx', 'json'], restoreMocks: true, testPathIgnorePatterns: [], diff --git a/react/javascript/tile-visualization/jest.config.js b/react/javascript/tile-visualization/jest.config.js index 1f31bd0..9e81c50 100644 --- a/react/javascript/tile-visualization/jest.config.js +++ b/react/javascript/tile-visualization/jest.config.js @@ -24,10 +24,13 @@ */ +const transformIgnorePatterns = + 'node_modules/@looker/extension-sdk-react|node_modules/@looker/extension-sdk|node_modules/@looker/sdk' + module.exports = { automock: false, moduleDirectories: ['./node_modules'], - transformIgnorePatterns: [], + transformIgnorePatterns: [transformIgnorePatterns], moduleFileExtensions: ['js', 'jsx', 'json'], restoreMocks: true, testPathIgnorePatterns: [], diff --git a/react/javascript/tile-visualization/src/TileExtension.spec.js b/react/javascript/tile-visualization/src/TileExtension.spec.js index 0151e1e..4277d26 100644 --- a/react/javascript/tile-visualization/src/TileExtension.spec.js +++ b/react/javascript/tile-visualization/src/TileExtension.spec.js @@ -32,6 +32,7 @@ import { TileExtension } from './TileExtension' describe('TileExtension', () => { test('it renders', async () => { const ok = (result) => result + const all_lookml_models = () => ['cypress_thelook'] const run_inline_query = () => [ { 'order_items.average_sale_price': 62.226985776129474, @@ -40,7 +41,7 @@ describe('TileExtension', () => { renderWithExtensionContext40( , {}, - { coreSDK: { run_inline_query, ok } } + { coreSDK: { all_lookml_models, run_inline_query, ok } } ) expect(await screen.findByText('Dashboard Tile')).toBeInTheDocument() })