Registry / testing / promises-es6-tests

promises-es6-tests

JSON →
library0.5.0jsnpmunverified

The `promises-es6-tests` package provides a compliance test suite specifically designed for the **draft** ECMA-262 6th Edition (ES6, now ES2015) Promises specification. Released at version 0.5.0, it explicitly states that it should not be considered final or complete and does not supersede the Promises/A+ test suite, advising users to run both. The package enables testing of Promise implementations in both Node.js and browser environments by requiring a minimal adapter interface, an extension of the Promises/A+ adapter. Due to its focus on a draft specification that was finalized as ES2015 in June 2015, and its last release being version 0.5.0, this package is effectively outdated and provides checks against an early, non-final version of the standard rather than the stable ES2015 Promises. Its utility for modern Promise implementations is therefore very limited, as the specification it targets has evolved significantly.

npm install promises-es6-tests
INSTALL
IMPORT
SIG · PROMISES-ES6-TESTS
P
promises-es6-tests
testingjavascriptv0.5.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

promisesES6Tests
import promisesES6Tests from 'promises-es6-tests';
import { promisesES6Tests } from 'promises-es6-tests';
The main export is a default function, not a named export. This package was published before widespread ESM usage.
promisesES6Tests (CommonJS)
const promisesES6Tests = require('promises-es6-tests');
This is the primary way the library was expected to be consumed in Node.js at the time of its last release.
CLI usage
promises-es6-tests test_adapter.js
node promises-es6-tests test_adapter.js
The package can be invoked directly from the command line after global installation or via npm scripts.
Browser global
<script src="node_modules/promises-es6-tests/bundle/promises-es6-tests.js"></script> // Global `promisesES6Tests` becomes available
For browser environments, the tests are bundled into a single file that exposes `promisesES6Tests` globally.

This quickstart demonstrates how to programmatically run the `promises-es6-tests` suite against a minimal adapter for a native Promise implementation in Node.js, reporting the number of test failures.

import promisesES6Tests from 'promises-es6-tests'; // Create a mock adapter that mimics a Promise library's interface // In a real scenario, this would import your actual Promise implementation const adapter = { // `Deferred` and `resolved`, `rejected` from Promises/A+ spec // For ES6 tests, we primarily need the global Promise object setup/teardown // and access to the Promise constructor being tested. // Example of a minimal adapter for a native Promise implementation // For a polyfill, these would modify `globalScope`. defineGlobalPromise: function (globalScope) { globalScope.Promise = Promise; // Use native Promise for testing globalScope.assert = require('assert'); // Node.js assert for tests }, removeGlobalPromise: function (globalScope) { delete globalScope.Promise; delete globalScope.assert; }, // The `resolve` and `reject` methods are from the Promises/A+ adapter spec // and might not be directly used by all ES6 tests, but are part of the expected interface. resolved: Promise.resolve.bind(Promise), rejected: Promise.reject.bind(Promise) }; console.log('Running promises-es6-tests...'); promisesES6Tests(adapter, function (err) { if (err) { console.error(`Promises ES6 tests failed with ${err} failures.`); process.exit(err); } else { console.log('Promises ES6 tests passed successfully.'); process.exit(0); } });
Debug
Known issues
gotchaThis test suite is designed for the **draft** ECMA-262 6th Edition (ES6) Promises specification, not the final ES2015 standard. The Promises specification has evolved since this suite was last updated, and passing these tests does not guarantee compliance with the current ECMAScript standard.
fix
For current ECMAScript Promise compliance, refer to official test262 project or more recent testing libraries.
affects: 0.5.0
gotchaThese tests are orthogonal to, and do NOT supersede, the Promises/A+ tests. Implementations should run both `promises-aplus-tests` and `promises-es6-tests` for comprehensive coverage of `then()` method behavior (A+) and ES6-specific Promise constructor features (ES6).
fix
Ensure your test runner executes both `promises-aplus-tests` and `promises-es6-tests` (if targeting the specific ES6 draft features).
affects: 0.5.0
deprecatedThe package's last update (v0.5.0) predates the finalization of the ES2015 (ES6) specification in June 2015. Given its explicit targeting of a 'draft' specification and lack of subsequent updates, the library is effectively abandoned and its relevance for modern JavaScript development is minimal.
fix
Consider newer, actively maintained test suites for modern Promise compliance, or integrate directly with the official test262 project.
affects: 0.5.0
gotchaThe adapter interface requires specific `defineGlobalPromise` and `removeGlobalPromise` functions to control the global `Promise` and `assert` objects during testing. These functions must correctly manipulate the `globalScope` object passed to them, especially for polyfills, rather than the global object directly.
fix
Carefully implement the `defineGlobalPromise` and `removeGlobalPromise` methods in your adapter to correctly set up and tear down the `Promise` implementation under test within the provided `globalScope`.
affects: 0.5.0
Errors
Common errors & fixes
promises-es6-tests: command not found
The `promises-es6-tests` executable is not in the system's PATH, typically because it wasn't installed globally or `npm run` is not being used for local installation.
fix
Install the package globally: `npm install -g promises-es6-tests` or run it from a local `node_modules/.bin` via `npm test` script: `"test": "promises-es6-tests test_adapter.js"`.
TypeError: adapter.defineGlobalPromise is not a function
The provided adapter object is missing the required `defineGlobalPromise` method or it's not a function.
fix
Ensure your adapter object implements all required methods as specified in the README, including `defineGlobalPromise(globalScope)` and `removeGlobalPromise(globalScope)`.
UnhandledPromiseRejectionWarning: TypeError: Promise resolver non-object is not a constructor
The `Promise` object exposed by the adapter or the test environment is not a valid Promise constructor or is improperly set up, often occurring when a non-standard or malformed Promise implementation is used.
fix
Verify that the `Promise` constructor made available to the tests via your adapter's `defineGlobalPromise` is a proper, spec-compliant Promise constructor.
Upgrade
Version history
0.5.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
promises-es6-tests — npm install promises-es6-tests · libregistry