Skip to content

Commit

Permalink
feat: make windows flow pass
Browse files Browse the repository at this point in the history
Signed-off-by: SuZhou-Joe <[email protected]>
  • Loading branch information
SuZhou-Joe committed Nov 10, 2023
1 parent 01c7547 commit b946d8e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 23 deletions.
18 changes: 0 additions & 18 deletions .babelrc

This file was deleted.

26 changes: 26 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

// babelrc doesn't respect NODE_PATH anymore but using require does.
// Alternative to install them locally in node_modules
module.exports = function (api) {
// ensure env is test so that this config won't impact build or dev server
if (api.env('test')) {
return {
presets: [
require('@babel/preset-env'),
require('@babel/preset-react'),
require('@babel/preset-typescript'),
],
plugins: [
[require('@babel/plugin-transform-runtime'), { regenerator: true }],
require('@babel/plugin-proposal-class-properties'),
require('@babel/plugin-proposal-object-rest-spread'),
[require('@babel/plugin-transform-modules-commonjs'), { allowTopLevelThis: true }],
],
};
}
return {};
};
6 changes: 1 addition & 5 deletions test/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ module.exports = {
'<rootDir>/public/requests/',
'/__utils__/',
],
transform: {
'^.+\\.tsx?$': ['ts-jest', { diagnostics: false }],
'node_modules/(langchain|langsmith)/.+\\.js$': ['ts-jest', { diagnostics: false }],
},
transformIgnorePatterns: ['<rootDir>/node_modules/(?!langchain|langsmith)'],
transformIgnorePatterns: ['node_modules/(?!langchain|langsmith)'],
moduleNameMapper: {
'\\.(css|less|sass|scss)$': '<rootDir>/test/__mocks__/styleMock.js',
'\\.(gif|ttf|eot|svg|png)$': '<rootDir>/test/__mocks__/fileMock.js',
Expand Down

0 comments on commit b946d8e

Please sign in to comment.