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 acceptance tests #2194

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,23 @@ jobs:
- run: yarn update && git diff --exit-code

- run: yarn test:coverage --runInBand

acceptance:
runs-on: ${{ matrix.os }}-latest

strategy:
matrix:
os: [ ubuntu, windows ]
node-version: [18.x, 20.x, 21.x]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- run: yarn install --frozen-lockfile --non-interactive
- run: yarn vitest
13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"test": "jest",
"test:coverage": "jest --coverage",
"test:watch": "jest --watchAll",
"test:acceptance": "vitest --config ./tests/acceptance/vitest.config.mjs",
"update": "node ./scripts/update-rules.js && node ./scripts/list-jquery-methods.js && npm-run-all update:eslint-docs",
"update:eslint-docs": "eslint-doc-generator"
},
Expand All @@ -71,7 +72,8 @@
"**/tests/**/*.js"
],
"testPathIgnorePatterns": [
"<rootDir>/tests/helpers/"
"<rootDir>/tests/helpers/",
"<rootDir>/tests/acceptance"
]
},
"dependencies": {
Expand Down Expand Up @@ -108,7 +110,10 @@
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-unicorn": "^51.0.0",
"eslint-remote-tester": "^3.0.1",
"execa": "^9.4.1",
"fixturify-project": "^7.1.2",
"globals": "^14.0.0",
"globby": "^14.0.2",
"jest": "^29.7.0",
"jquery": "^3.7.1",
"jsdom": "^24.0.0",
Expand All @@ -117,9 +122,13 @@
"npm-run-all": "^4.1.5",
"prettier": "^3.0.3",
"release-it": "^17.0.0",
"scenario-tester": "^4.1.1",
"sort-package-json": "^2.6.0",
"tmp-promise": "^3.0.3",
"typescript": "^5.2.2",
"typescript-eslint": "^8.7.0"
"typescript-eslint": "^8.7.0",
"vite": "^5.4.9",
"vitest": "^2.1.3"
},
"peerDependencies": {
"@typescript-eslint/parser": "*",
Expand Down
17 changes: 17 additions & 0 deletions tests/acceptance/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import globals from 'globals';

Check failure on line 1 in tests/acceptance/eslint.config.mjs

View workflow job for this annotation

GitHub Actions / build (ubuntu, 18.x)

Filename 'eslint.config.mjs' does not match the naming convention

Check failure on line 1 in tests/acceptance/eslint.config.mjs

View workflow job for this annotation

GitHub Actions / build (ubuntu, 20.x)

Filename 'eslint.config.mjs' does not match the naming convention

Check failure on line 1 in tests/acceptance/eslint.config.mjs

View workflow job for this annotation

GitHub Actions / build (ubuntu, 21.x)

Filename 'eslint.config.mjs' does not match the naming convention
import n from 'eslint-plugin-n';
import prettier from 'eslint-plugin-prettier/recommended';

export default [
prettier,
n.configs['flat/recommended'],
{
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.node,
},
},
},
];
5 changes: 5 additions & 0 deletions tests/acceptance/fixtures/plain-gjs/demo.gjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const foo = 2;

<template>
{{foo}}
</template>
57 changes: 57 additions & 0 deletions tests/acceptance/fixtures/plain-gjs/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import globals from 'globals';
import js from '@eslint/js';

import ember from 'eslint-plugin-ember/recommended';

const esmParserOptions = {
ecmaFeatures: { modules: true },
ecmaVersion: 'latest',
requireConfigFile: false,
babelOptions: {
plugins: [['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }]],
},
};

export default [
js.configs.recommended,
ember.base,
ember.gjs,
/**
* Ignores must be in their own object
* https://eslint.org/docs/latest/use/configure/ignore
*/
{
ignores: ['dist/', 'node_modules/', 'coverage/', '!**/.*'],
},
/**
* https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options
*/
{
linterOptions: {
reportUnusedDisableDirectives: 'error',
},
},
{
files: ['**/*.{js,gjs}'],
languageOptions: {
parserOptions: esmParserOptions,
globals: {
...globals.browser,
},
},
},
/**
* ESM node files
*/
{
files: ['**/*.mjs'],
languageOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
parserOptions: esmParserOptions,
globals: {
...globals.node,
},
},
},
];
9 changes: 9 additions & 0 deletions tests/acceptance/fixtures/plain-gjs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "fixture-plain-gjs",
"version": "0.0.0",
"private": true,
"type": "module",
"devDependencies": {
"eslint": "^9.13.0",
}
}
Loading
Loading