-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[ENHANCEMENT] Add support for --typescript
flag to app
and addon
blueprints
#9972
Changes from all commits
d1a1971
25b76cb
d83467f
5b0032a
b25bd03
8f3f5ff
7c452dc
e4e7029
d0cbbd0
874a920
66f0e29
8a042cd
a8683ad
09ada8f
85f99a5
490e73d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { | ||
setupApplicationTest as upstreamSetupApplicationTest, | ||
setupRenderingTest as upstreamSetupRenderingTest, | ||
setupTest as upstreamSetupTest, | ||
SetupTestOptions, | ||
} from 'ember-qunit'; | ||
|
||
// This file exists to provide wrappers around ember-qunit's / ember-mocha's | ||
// test setup functions. This way, you can easily extend the setup that is | ||
// needed per test type. | ||
|
||
function setupApplicationTest(hooks: NestedHooks, options?: SetupTestOptions) { | ||
upstreamSetupApplicationTest(hooks, options); | ||
|
||
// Additional setup for application tests can be done here. | ||
// | ||
// For example, if you need an authenticated session for each | ||
// application test, you could do: | ||
// | ||
// hooks.beforeEach(async function () { | ||
// await authenticateSession(); // ember-simple-auth | ||
// }); | ||
// | ||
// This is also a good place to call test setup functions coming | ||
// from other addons: | ||
// | ||
// setupIntl(hooks); // ember-intl | ||
// setupMirage(hooks); // ember-cli-mirage | ||
} | ||
|
||
function setupRenderingTest(hooks: NestedHooks, options?: SetupTestOptions) { | ||
upstreamSetupRenderingTest(hooks, options); | ||
|
||
// Additional setup for rendering tests can be done here. | ||
} | ||
|
||
function setupTest(hooks: NestedHooks, options?: SetupTestOptions) { | ||
upstreamSetupTest(hooks, options); | ||
|
||
// Additional setup for unit tests can be done here. | ||
} | ||
|
||
export { setupApplicationTest, setupRenderingTest, setupTest }; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -311,7 +311,7 @@ class Project { | |
if (fs.existsSync(`${targetsPath}.js`)) { | ||
this._targets = this.require(targetsPath); | ||
} else { | ||
this._targets = require('../../blueprints/app/files/config/targets'); | ||
this._targets = { browsers: ['last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions'] }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When requiring Previously this caused no issues, as the only parts with "template tags" (or whatever you call these As |
||
} | ||
return this._targets; | ||
} | ||
|
@@ -496,6 +496,7 @@ class Project { | |
return; | ||
} | ||
this._addonsInitialized = true; | ||
this._didDiscoverAddons = false; | ||
simonihmig marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
logger.info('initializeAddons for: %s', this.name()); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this has been changed/fixed in more recent versions of ESLint, but the last I checked, a glob like this would still require you to specify
--ext .js,.ts
when executing the linter. I've found just'*.ts'
still enables linting for nested files while also being simple enough for ESLint to understand it should automatically lint.ts
files as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have this config in a few addons/projects without any problems! 🤷♂️