第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

js中的一條測試用例在調(diào)用主函數(shù)時(shí),總是返回undefined

js中的一條測試用例在調(diào)用主函數(shù)時(shí),總是返回undefined

測試函數(shù)let sinon = require("sinon");let main = require("../lib/main");describe('main()', () => {    it('should display main menu once started', () => {        sinon.spy(console, 'log');        main();        expect(console.log.args.join()).toBe(`1. 添加學(xué)生2. 生成成績單3. 退出請輸入你的選擇(1~3):`);    });    it('should display 請輸入學(xué)生信息(格式:姓名, 學(xué)號, 民族, 班級, 學(xué)科: 成績, ...)', () => {        // sinon.spy(console, 'log');        const display = main();        // console.log(display)        expect(display).toBe('請輸入學(xué)生信息(格式:姓名, 學(xué)號, 民族, 班級, 學(xué)科: 成績, ...),按回車提交:')    }) });被測函數(shù)module.exports = () => {    function choice1(){        let display = '請輸入學(xué)生信息(格式:姓名, 學(xué)號, 民族, 班級, 學(xué)科: 成績, ...),按回車提交:'        return display;    }    function choice2(){        }    function choice3(){        }    function invalidInput1(){        }    function defaultPage(){        console.log( `1. 添加學(xué)生2. 生成成績單3. 退出請輸入你的選擇(1~3):`)    }    defaultPage();    var readlineSync = require('readline-sync');    var answer = readlineSync.question();    if(answer == 1){        choice1();    }else if(answer == 2){        choice2();    }else if(answer == 3){        choice3();    }else{        return 'Bad choice, please choose again!'    }}運(yùn)行結(jié)果
查看完整描述

1 回答

?
慕桂英546537

TA貢獻(xiàn)1848條經(jīng)驗(yàn) 獲得超10個(gè)贊

if(answer == 1){ return choice1(); }


查看完整回答
反對 回復(fù) 2019-04-08
  • 1 回答
  • 0 關(guān)注
  • 307 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號