Skip to content

Commit 34614f0

Browse files
sanjaikumar-brunorsxcsanjai0py
authored
Autocomplete random variables (#4695)
* Feature: adding dynamic variable support (#3609) Co-authored-by: Raghav Sethi <[email protected]> Co-authored-by: sanjai0py <[email protected]>
1 parent acd42ea commit 34614f0

File tree

15 files changed

+398
-137
lines changed

15 files changed

+398
-137
lines changed

eslint.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ module.exports = defineConfig([
2525
"no-undef": "error",
2626
},
2727
},
28+
{
29+
// It prevents lint errors when using CommonJS exports (module.exports) in Jest mocks.
30+
files: ["packages/bruno-app/src/test-utils/mocks/codemirror.js"],
31+
languageOptions: {
32+
globals: {
33+
...globals.node,
34+
...globals.jest,
35+
},
36+
},
37+
rules: {
38+
"no-undef": "error",
39+
},
40+
},
2841
{
2942
files: ["packages/bruno-electron/**/*.{js}"],
3043
ignores: ["**/*.config.js"],

package-lock.json

Lines changed: 113 additions & 122 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/bruno-app/.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"presets": ["@babel/preset-env"],
2+
"presets": ["@babel/preset-env", "@babel/preset-react"],
33
"plugins": [["styled-components", { "ssr": true }]]
44
}

packages/bruno-app/jest.config.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
module.exports = {
22
rootDir: '.',
3+
transform: {
4+
'^.+\\.[jt]sx?$': 'babel-jest',
5+
},
6+
transformIgnorePatterns: [
7+
"/node_modules/(?!strip-json-comments|nanoid|xml-formatter)/",
8+
],
39
moduleNameMapper: {
410
'^assets/(.*)$': '<rootDir>/src/assets/$1',
511
'^components/(.*)$': '<rootDir>/src/components/$1',
@@ -8,18 +14,17 @@ module.exports = {
814
'^api/(.*)$': '<rootDir>/src/api/$1',
915
'^pageComponents/(.*)$': '<rootDir>/src/pageComponents/$1',
1016
'^providers/(.*)$': '<rootDir>/src/providers/$1',
11-
'^utils/(.*)$': '<rootDir>/src/utils/$1'
17+
'^utils/(.*)$': '<rootDir>/src/utils/$1',
18+
'^test-utils/(.*)$': '<rootDir>/src/test-utils/$1'
1219
},
1320
clearMocks: true,
1421
moduleDirectories: ['node_modules', 'src'],
1522
testEnvironment: 'jsdom',
16-
transform: {
17-
'^.+\\.[jt]sx?$': 'babel-jest'
18-
},
19-
transformIgnorePatterns: [
20-
'/node_modules/(?!(nanoid|xml-formatter)/)'
23+
setupFilesAfterEnv: ['@testing-library/jest-dom'],
24+
setupFiles: [
25+
'<rootDir>/jest.setup.js',
2126
],
2227
testMatch: [
2328
'<rootDir>/src/**/*.spec.[jt]s?(x)'
2429
]
25-
};
30+
};

packages/bruno-app/jest.setup.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
jest.mock('nanoid', () => {
2+
return {
3+
nanoid: () => {}
4+
};
5+
});
6+
7+
jest.mock('strip-json-comments', () => {
8+
return {
9+
stripJsonComments: (str) => str
10+
};
11+
});

packages/bruno-app/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@
9191
"@rsbuild/plugin-react": "^1.0.7",
9292
"@rsbuild/plugin-sass": "^1.1.0",
9393
"@rsbuild/plugin-styled-components": "1.1.0",
94-
"@testing-library/dom": "^9.3.3",
95-
"@testing-library/jest-dom": "^6.1.5",
96-
"@testing-library/react": "^14.1.2",
94+
"@testing-library/jest-dom": "^6.6.3",
95+
"@testing-library/react": "^16.3.0",
96+
"@testing-library/dom": "^10.4.0",
9797
"autoprefixer": "10.4.20",
9898
"babel-jest": "^29.7.0",
9999
"babel-plugin-react-compiler": "19.0.0-beta-a7bf2bd-20241110",

packages/bruno-app/rsbuild.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ export default defineConfig({
2020
],
2121
source: {
2222
tsconfigPath: './jsconfig.json', // Specifies the path to the JavaScript/TypeScript configuration file,
23+
exclude: [
24+
'**/test-utils/**',
25+
'**/*.test.*',
26+
'**/*.spec.*'
27+
]
2328
},
2429
html: {
2530
title: 'Bruno'

0 commit comments

Comments
 (0)