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

Add updated test helpers as peer widen version #1069

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address lint issues
NullVoxPopuli committed May 4, 2023
commit 020840e66fb151de6b7fa023b496dfa73b090da3
49 changes: 49 additions & 0 deletions addon/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
'use strict';

module.exports = {
root: true,
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
babelOptions: {
root: __dirname,
},
},
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true,
},
rules: {
'ember/no-test-support-import': 'off',
'ember/no-classic-classes': 'off',
},
overrides: [
// node files
{
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.template-lintrc.js',
'./addon-main.js',
],
parserOptions: {
sourceType: 'script',
},
env: {
browser: false,
node: true,
},
plugins: ['node'],
extends: ['plugin:node/recommended'],
},
],
};
66 changes: 0 additions & 66 deletions addon/.eslintrc.js

This file was deleted.

102 changes: 0 additions & 102 deletions addon/index.js

This file was deleted.

2 changes: 0 additions & 2 deletions addon/package.json
Original file line number Diff line number Diff line change
@@ -31,9 +31,7 @@
"build": "rollup --config",
"lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'",
"lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
"lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
"lint:js": "eslint . --cache",
"lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
"lint:js:fix": "eslint . --fix",
"start": "rollup --config --watch",
"test:types": "tsc --noEmit --project types",
4 changes: 2 additions & 2 deletions addon/src/adapter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Ember from 'ember';
import TestAdapter from '@ember/test/adapter';
import * as QUnit from 'qunit';
import hasEmberVersion from '@ember/test-helpers/has-ember-version';

@@ -27,7 +27,7 @@ function unhandledRejectionAssertion(current, error) {

export function nonTestDoneCallback() {}

let Adapter = Ember.Test.Adapter.extend({
let Adapter = TestAdapter.extend({
init() {
this.doneCallbacks = [];
this.qunit = this.qunit || QUnit;
2 changes: 2 additions & 0 deletions addon/src/index.js
Original file line number Diff line number Diff line change
@@ -124,10 +124,12 @@ export function setupTestAdapter() {
*/
export function setupEmberTesting() {
QUnit.testStart(() => {
// eslint-disable-next-line ember/no-ember-testing-in-module-scope
Ember.testing = true;
});

QUnit.testDone(() => {
// eslint-disable-next-line ember/no-ember-testing-in-module-scope
Ember.testing = false;
});
}