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

Tests: Test upstream config for node #530

Merged
merged 3 commits into from
Aug 18, 2023
Merged
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
2 changes: 1 addition & 1 deletion test/fixtures/server/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"settings": {
"node": {
"version": ">=10.0.0"
"version": ">=11.0.0"
}
}
}
6 changes: 3 additions & 3 deletions test/fixtures/server/invalid.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
// eslint-disable-next-line n/no-unsupported-features/node-builtins
crypto.verify();

// TODO: eslint-disable-next-line n/no-extraneous-require
// TODO: eslint-disable-next-line n/no-unpublished-bin
// TODO: eslint-disable-next-line n/process-exit-as-throw
// TODO: <!-- eslint-disable-next-line n/no-extraneous-require -->
// TODO: <!-- eslint-disable-next-line n/no-unpublished-bin -->
// TODO: <!-- eslint-disable-next-line n/process-exit-as-throw -->

// not-es2018
// eslint-disable-next-line es-x/no-string-prototype-trimstart-trimend
Expand Down
109 changes: 109 additions & 0 deletions test/fixtures/server/valid.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,113 @@
// Off: es-x/no-symbol-prototype-description
global.desc = a.description;

/* Globals */
console.log(
// Global: ArrayBuffer
ArrayBuffer,
// Global: Atomics
Atomics,
// Global: BigInt
// Can't assert due to es-x/no-bigint
// BigInt,
// Global: BigInt64Array
// Can't assert due to es-x/no-bigint
// BigInt64Array,
// Global: BigUint64Array
// Can't assert due to es-x/no-bigint
// BigUint64Array,
// Global: DataView
DataView,
// Global: Float32Array
Float32Array,
// Global: Float64Array
Float64Array,
// Global: Int16Array
Int16Array,
// Global: Int32Array
Int32Array,
// Global: Int8Array
Int8Array,
// Global: Map
Map,
// Global: Promise
Promise,
// Global: Proxy
Proxy,
// Global: Reflect
Reflect,
// Global: Set
Set,
// Global: SharedArrayBuffer
SharedArrayBuffer,
// Global: Symbol
Symbol,
// Global: Uint16Array
Uint16Array,
// Global: Uint32Array
Uint32Array,
// Global: Uint8Array
Uint8Array,
// Global: Uint8ClampedArray
Uint8ClampedArray,
// Global: WeakMap
WeakMap,
// Global: WeakSet
WeakSet,
// Global: globalThis
// Can't assert due to es-x/no-global-this
// globalThis,
// Global: Intl
Intl,
// Global: TextDecoder
TextDecoder,
// Global: TextEncoder
TextEncoder,
// Global: URL
URL,
// Global: URLSearchParams
URLSearchParams,
// Global: WebAssembly
WebAssembly,
// Global: clearInterval
clearInterval,
// Global: clearTimeout
clearTimeout,
// Global: console
console,
// Global: queueMicrotask
// Can't assert due to n/no-unsupported-features/node-builtins
// queueMicrotask,
// Global: setInterval
setInterval,
// Global: setTimeout
setTimeout,
// Global: Buffer
Buffer,
// Global: GLOBAL
// Can't assert due to n/no-deprecated-api
// GLOBAL,
// Global: clearImmediate
clearImmediate,
// Global: global
global,
// Global: process
process,
// Global: root
// Can't assert due to n/no-deprecated-api
// root,
// Global: setImmediate
setImmediate,
// Global: __dirname
__dirname,
// Global: __filename
__filename,
// Global: exports
exports,
// Global: module
module,
// Global: require
require
);

}( this ) );
3 changes: 3 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ configs.forEach( ( configPath ) => {
getRules( require( '../language/rules-es6' ) )
// ES5 rules are tested in client-es5
);

// Test node's upstream rules
( { rules, globals } = extendRules( require( '../node' ), rules, globals ) );
}

if ( configName === 'client-es5' ) {
Expand Down
Loading