--- /dev/null
+'use strict';
+
+const assert = require('node:assert');
+const sinon = require('sinon');
+const stdioCredential = require('../../lib/stdio-credential');
+const readline = require('node:readline');
+
+describe('stdioCredential', function () {
+ let answerCb, prompt;
+
+ beforeEach(function () {
+ sinon.stub(readline, 'createInterface').callsFake(({ input, output, terminal }) => {
+ return {
+ close: () => undefined,
+ prompt: () => {
+ output.write(prompt);
+ },
+ question: (_message, cb) => {
+ output.write(prompt);
+ answerCb = cb;
+ },
+ setPrompt: (p) => {
+ prompt = p;
+ },
+ };
+ });
+ });
+
+ afterEach(function () {
+ sinon.restore();
+ });
+
+ it('covers', async function () {
+ const input = 'password';
+ const resultP = stdioCredential('prompt>');
+ answerCb(input);
+ const result = await resultP;
+ assert.strictEqual(result, input);
+ });
+}); // stdioCredential
\ No newline at end of file