Skip to content

Commit

Permalink
[TECH] Migrer les tests mocha de Pix App sous QUnit (PIX-6330).
Browse files Browse the repository at this point in the history
  • Loading branch information
pix-service-auto-merge authored Nov 23, 2022
2 parents 08d845b + ffd5e9f commit 96b984a
Show file tree
Hide file tree
Showing 390 changed files with 13,157 additions and 9,427 deletions.
8 changes: 2 additions & 6 deletions mon-pix/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ module.exports = {
plugins: [['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }]],
},
},
plugins: ['ember', 'mocha'],
plugins: ['ember', 'qunit'],
extends: [
...(fs.existsSync('../.eslintrc.yaml') ? ['../.eslintrc.yaml'] : []),
'plugin:ember/recommended',
'plugin:qunit/recommended',
'plugin:i18n-json/recommended',
'plugin:prettier/recommended',
],
Expand All @@ -37,10 +38,6 @@ module.exports = {
order: ['attribute', 'relationship', 'single-line-function', 'multi-line-function'],
},
],
'mocha/no-exclusive-tests': 'error',
'mocha/no-identical-title': 'error',
'mocha/no-skipped-tests': 'warn',
'mocha/no-mocha-arrows': 'error',
/* Recommended rules */
'ember/no-mixins': 'off',
'i18n-json/sorted-keys': [
Expand Down Expand Up @@ -88,7 +85,6 @@ module.exports = {
excludedFiles: ['tests/dummy/**/*.js'],
env: {
embertest: true,
mocha: true,
},
globals: {
server: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { describe, it } from 'mocha';
import { expect } from 'chai';
import { setupApplicationTest } from 'ember-mocha';
import { module, test } from 'qunit';
import { setupApplicationTest } from 'ember-qunit';
import { visit, currentURL } from '@ember/test-helpers';

describe('Acceptance | <%= dasherizedModuleName %>', function() {
setupApplicationTest();
module('Acceptance | <%= dasherizedModuleName %>', function (hooks) {
setupApplicationTest(hooks);

it('can visit /<%= dasherizedModuleName %>', async function() {
test('can visit /<%= dasherizedModuleName %>', async function (assert) {
await visit('/<%= dasherizedModuleName %>');
expect(currentURL()).to.equal('/<%= dasherizedModuleName %>');
assert.strictEqual(currentURL(), '/<%= dasherizedModuleName %>');
});
});
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupTest } from 'ember-mocha';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';

describe('Unit | Adapter | <%= dasherizedModuleName %>', function () {
setupTest();
module('Unit | Adapter | <%= dasherizedModuleName %>', function(hooks) {
setupTest(hooks);

// Replace this with your real tests.
it('exists', function () {
test('exists', function(assert) {
const adapter = this.owner.lookup('adapter:<%= classifiedModuleName %>');
expect(adapter).to.be.ok;
assert.ok(adapter);
});
});
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupRenderingTest } from 'ember-mocha';
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';

describe('Integration | Component | <%= dasherizedModuleName %>', function() {
setupRenderingTest();
module('Integration | Component | <%= dasherizedModuleName %>', function (hooks) {
setupRenderingTest(hooks);

it('replace this by your real test', async function() {
test('replace this by your real test', async function (assert) {
// given

// when
await render(hbs`<<%= classifiedModuleName %> />`);

// then
expect(true).to.be.true;
assert.strictEqual(true, true);
});
});
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupTest } from 'ember-mocha';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';

describe('Unit | Route | <%= dasherizedModuleName %>', function () {
setupTest();
module('Unit | Route | <%= dasherizedModuleName %>', function(hooks) {
setupTest(hooks);

it('exists', function () {
test('exists', function(assert) {
const route = this.owner.lookup('route:<%= classifiedModuleName %>');
expect(route).to.be.ok;
assert.ok(route);
});
});
Loading

0 comments on commit 96b984a

Please sign in to comment.