Skip to content

Commit

Permalink
- adds langchain to transformIgnorePatterns to resolve build errors:
Browse files Browse the repository at this point in the history
```
Test Failures
[job] [logs] Jest Integration Tests #1 / checking migration metadata changes on all registered SO types detecting migration related changes in registered types
[job] [logs] Jest Integration Tests #4 / Fleet preconfiguration reset Preconfigured cloud policy Adding APM to a preconfigured agent policy after first setup Create a .fleet-policies document with the APM package policy
[job] [logs] Jest Integration Tests #4 / Fleet preconfiguration reset Preconfigured cloud policy Adding APM to a preconfigured agent policy after first setup Create correct package policies
[job] [logs] Jest Integration Tests #4 / Fleet preconfiguration reset Preconfigured cloud policy Adding APM to a preconfigured agent policy after first setup Works and preconfigure correctly agent policies
[job] [logs] Jest Integration Tests #4 / Fleet preconfiguration reset Preconfigured cloud policy Adding package policy id to a preconfigured package policy after first setup Create correct package policies and use the name of package policies instead of id
```

```
_bk;t=1693071319187[0m[7m[1m[31m FAIL [39m[22m[27m[0m [2msrc/core/server/integration_tests/saved_objects/migrations/group2/[22m[1mcheck_registered_types.test.ts[22m ([0m[1m[41m191.694 s[49m[22m[0m)
_bk;t=1693071319187[1m[31m  [1m● [22m[1mchecking migration metadata changes on all registered SO types › detecting migration related changes in registered types[39m[22m
_bk;t=1693071319187
_bk;t=1693071319187    [1m[31mJest encountered an unexpected token[39m[22m
_bk;t=1693071319187
_bk;t=1693071319187    Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.
_bk;t=1693071319187
_bk;t=1693071319187    Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.
_bk;t=1693071319187
_bk;t=1693071319187    By default "node_modules" folder is ignored by transformers.
_bk;t=1693071319187
_bk;t=1693071319187    Here's what you can do:
_bk;t=1693071319187     • If you are trying to use ECMAScript Modules, see [4mhttps://jestjs.io/docs/ecmascript-modules[24m for how to enable it.
_bk;t=1693071319187     • If you are trying to use TypeScript, see [4mhttps://jestjs.io/docs/getting-started#using-typescript[24m
_bk;t=1693071319187     • To have some of your "node_modules" files transformed, you can specify a custom [1m"transformIgnorePatterns"[22m in your config.
_bk;t=1693071319187     • If you need a custom transformation specify a [1m"transform"[22m option in your config.
_bk;t=1693071319187     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the [1m"moduleNameMapper"[22m config option.
_bk;t=1693071319187
_bk;t=1693071319187    You'll find more details and examples of these config options in the docs:
_bk;t=1693071319187    [36mhttps://jestjs.io/docs/configuration[39m
_bk;t=1693071319187    For information about custom transformations, see:
_bk;t=1693071319187    [36mhttps://jestjs.io/docs/code-transformation[39m
_bk;t=1693071319187
_bk;t=1693071319187    [1m[31mDetails:[39m[22m
_bk;t=1693071319187
_bk;t=1693071319187    /var/lib/buildkite-agent/builds/kb-n2-4-spot-cd6b00b1aaa987f6/elastic/kibana-pull-request/kibana/node_modules/langchain/schema.js:1
_bk;t=1693071319187    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){export * from './dist/schema/index.js'
_bk;t=1693071319187                                                                                      ^^^^^^
_bk;t=1693071319187
_bk;t=1693071319187    SyntaxError: Unexpected token 'export'
```
  • Loading branch information
andrew-goldstein committed Aug 28, 2023
1 parent 4cc865e commit 1244b58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/kbn-test/jest-preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ module.exports = {
transformIgnorePatterns: [
// ignore all node_modules except monaco-editor and react-monaco-editor which requires babel transforms to handle dynamic import()
// since ESM modules are not natively supported in Jest yet (https://github.com/facebook/jest/issues/4842)
'[/\\\\]node_modules(?![\\/\\\\](byte-size|monaco-editor|monaco-yaml|vscode-languageserver-types|react-monaco-editor|d3-interpolate|d3-color))[/\\\\].+\\.js$',
'[/\\\\]node_modules(?![\\/\\\\](byte-size|monaco-editor|monaco-yaml|vscode-languageserver-types|react-monaco-editor|d3-interpolate|d3-color|langchain))[/\\\\].+\\.js$',
'packages/kbn-pm/dist/index.js',
],

Expand Down

0 comments on commit 1244b58

Please sign in to comment.