Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests & tslint for src/addons directory #1754

Merged

Conversation

paitonic
Copy link
Contributor

Long story short, I wanted to work on a bug but I noticed that tests and the tslint are not running for src/addons directory (intentionally?), this is my attempt to fix this

  • removed src/addons from exclude from tsconfig.js
  • fixed tslint errors
  • before the change there were 549 passing tests, now there are 560

tsconfig.json Outdated
@@ -20,8 +20,5 @@
"include": [
"src/**/*",
"typings/xterm.d.ts"
],
"exclude": [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't not exclude this as the source is part of a different tsconfig.json. The tests are meant to be included here:

xterm.js/gulpfile.js

Lines 25 to 30 in 37972aa

const TEST_PATHS = [
`${outDir}/*test.js`,
`${outDir}/**/*test.js`,
`${outDir}/*integration.js`,
`${outDir}/**/*integration.js`
];

yarn test runs gulp mocha which picks up these source files. Maybe there's a problem with the gulp task? Did you have the addons built before you ran yarn test (yarn watch-addons)?

Copy link
Contributor Author

@paitonic paitonic Oct 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To reproduce this, I've deleted build/, lib/ directories and run yarn build and yarn test.
It seems that the issue is with only src/search.test.js that gets lost somewhere. I've installed gulp plugin to output the file paths that gulp.src() emits in the mocha task:

[22:03:00] Using gulpfile ~/src/xterm.js/gulpfile.js
[22:03:00] Starting 'mocha'...
[22:03:00] Using ./lib/Buffer.test.js
[22:03:00] Using ./lib/BufferLine.test.js
[22:03:00] Using ./lib/BufferSet.test.js
[22:03:00] Using ./lib/CharWidth.test.js
[22:03:00] Using ./lib/CompositionHelper.test.js
[22:03:00] Using ./lib/EscapeSequenceParser.test.js
[22:03:00] Using ./lib/InputHandler.test.js
[22:03:00] Using ./lib/Linkifier.test.js
[22:03:00] Using ./lib/SelectionManager.test.js
[22:03:00] Using ./lib/SelectionModel.test.js
[22:03:00] Using ./lib/Terminal.test.js
[22:03:00] Using ./lib/common/CircularList.test.js
[22:03:00] Using ./lib/common/EventEmitter.test.js
[22:03:00] Using ./lib/common/Lifecycle.test.js
[22:03:00] Using ./lib/public/Terminal.test.js
[22:03:00] Using ./lib/handlers/Clipboard.test.js
[22:03:00] Using ./lib/renderer/CharacterJoinerRegistry.test.js
[22:03:00] Using ./lib/renderer/ColorManager.test.js
[22:03:00] Using ./lib/renderer/GridCache.test.js
[22:03:00] Using ./lib/utils/Clone.test.js
[22:03:00] Using ./lib/utils/MouseHelper.test.js
[22:03:00] Using ./lib/utils/TestUtils.test.js
[22:03:00] Using ./lib/ui/CharMeasure.test.js
[22:03:00] Using ./lib/addons/fit/fit.test.js
[22:03:00] Using ./lib/addons/fullscreen/fullscreen.test.js
[22:03:00] Using ./lib/addons/attach/attach.test.js
[22:03:00] Using ./lib/addons/terminado/terminado.test.js
[22:03:00] Using ./lib/addons/winptyCompat/winptyCompat.test.js
[22:03:00] Using ./lib/addons/zmodem/zmodem.test.js
[22:03:00] Using ./lib/addons/webLinks/webLinks.test.js
[22:03:00] Using ./lib/core/input/Keyboard.test.js
[22:03:00] Using ./lib/renderer/atlas/LRUMap.test.js
[22:03:00] Using ./lib/renderer/dom/DomRendererRowFactory.test.js
[22:03:00] Using ./lib/Terminal.integration.js

@@ -18,8 +18,5 @@
},
"include": [
"**/*.ts"
],
"exclude": [
"**/*.test.ts"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could reproduce as well and it looks like this was the problem, Can you undo the change to <root>/tsconfig.json?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I squashed the commits, the change in <root>/tsconfig.json is no longer there.

@paitonic paitonic force-pushed the run-tests-and-tslint-for-addons-directory branch from 447e9e0 to 3f3263c Compare October 25, 2018 18:10
@Tyriar Tyriar added this to the 3.9.0 milestone Nov 22, 2018
Copy link
Member

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @vladimirZe! Sorry about the delay 😃

@Tyriar Tyriar merged commit 6b89ec9 into xtermjs:master Nov 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants