Skip to content

Commit

Permalink
move examples/* to spec/
Browse files Browse the repository at this point in the history
  • Loading branch information
gfx committed Jul 9, 2024
1 parent 5e26a8c commit 6b8de88
Show file tree
Hide file tree
Showing 5 changed files with 160 additions and 1 deletion.
File renamed without changes.
112 changes: 112 additions & 0 deletions spec/eslint.mts.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"default": {
"root": true,
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/recommended",
"plugin:import/typescript",
"prettier"
],
"plugins": [
"@typescript-eslint/eslint-plugin",
"eslint-plugin-tsdoc"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"settings": {},
"rules": {
"no-constant-condition": [
"warn",
{
"checkLoops": false
}
],
"no-useless-escape": "warn",
"no-console": "warn",
"no-var": "warn",
"no-return-await": "warn",
"prefer-const": "warn",
"guard-for-in": "warn",
"curly": "warn",
"no-param-reassign": "warn",
"prefer-spread": "warn",
"import/no-unresolved": "off",
"import/no-cycle": "error",
"import/no-default-export": "warn",
"tsdoc/syntax": "warn",
"@typescript-eslint/await-thenable": "warn",
"@typescript-eslint/array-type": [
"warn",
{
"default": "generic"
}
],
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "default",
"format": [
"camelCase",
"UPPER_CASE",
"PascalCase"
],
"leadingUnderscore": "allow"
},
{
"selector": "typeLike",
"format": [
"PascalCase"
],
"leadingUnderscore": "allow"
}
],
"@typescript-eslint/restrict-plus-operands": "warn",
"@typescript-eslint/no-throw-literal": "warn",
"@typescript-eslint/unbound-method": "warn",
"@typescript-eslint/explicit-module-boundary-types": "warn",
"@typescript-eslint/no-extra-semi": "warn",
"@typescript-eslint/no-extra-non-null-assertion": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/no-use-before-define": "warn",
"@typescript-eslint/no-for-in-array": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-unnecessary-condition": [
"warn",
{
"allowConstantLoopConditions": true
}
],
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
"@typescript-eslint/no-implied-eval": "warn",
"@typescript-eslint/no-non-null-asserted-optional-chain": "warn",
"@typescript-eslint/no-invalid-void-type": "warn",
"@typescript-eslint/no-loss-of-precision": "warn",
"@typescript-eslint/no-confusing-void-expression": "warn",
"@typescript-eslint/no-redundant-type-constituents": "warn",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-includes": "warn",
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
"@typescript-eslint/prefer-readonly": "warn",
"@typescript-eslint/prefer-regexp-exec": "warn",
"@typescript-eslint/prefer-nullish-coalescing": "warn",
"@typescript-eslint/prefer-optional-chain": "warn",
"@typescript-eslint/prefer-ts-expect-error": "warn",
"@typescript-eslint/indent": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/ban-ts-comment": "off"
}
}
}
File renamed without changes.
47 changes: 47 additions & 0 deletions spec/jest.config.mts.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"default": {
"collectCoverage": true,
"collectCoverageFrom": [
"src/**/*.{js,jsx,ts,tsx}"
],
"coverageReporters": [
"lcov"
],
"moduleFileExtensions": [
"ts",
"tsx",
"mts",
"mtsx",
"cjs",
"js",
"jsx",
"mjs",
"mjsx",
"json",
"node"
],
"setupFilesAfterEnv": [
"console-fail-test/setup.js"
],
"testRegex": [
"./tests/.+\\.test\\.ts$",
"./tests/.+\\.spec\\.ts$"
],
"transform": {
"^.+\\.(t|j)sx?$": [
"@swc/jest",
{
"jsc": {
"target": "es2019",
"transform": {
"react": {
"runtime": "automatic"
}
}
}
}
]
},
"workerIdleMemoryLimit": "300MB"
}
}
2 changes: 1 addition & 1 deletion tests/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fn collect_specs(spec_dir: &Path) -> Vec<Spec> {

if path.is_file() {
let filename = path.file_name().unwrap().to_str().unwrap();
if filename.ends_with(".ts") {
if filename.ends_with(".ts") || filename.ends_with(".mts") {
let mut expected_stdout = String::new(); // $filename.stdout
let mut expected_stderr = String::new(); // $filename.stderr

Expand Down

0 comments on commit 6b8de88

Please sign in to comment.