fe-star / homework1 Goto Github PK
View Code? Open in Web Editor NEW作业1: 走完整个测试流程
作业1: 走完整个测试流程
虽然作业测试是通过的,但是感觉自己没有特别理解对象引用之间的关系。
两个测试用例同样都是引用的传过来的对象的地址,可是为什么第一个改变原对象,第二个却没有改变原对象。
希望老师可以出一个学习数据结构和算法的清单,就类似于我们每节课的预习清单一样,给一个数据结构和算法的清单,包括推荐的书籍,文档,博客都可以。
karma start 执行后,终端显示 ‘Executed 3 of 3 SUCCESS’等,浏览器也能打开了,但是怎样才能看到test.js中describle里描述的打印信息呢?
跪求karma跑的遛的同学可以分享karma的心得 及 对前端测试的经验心得 /:@)
短短一节课几个demo,完全体会到前端测试的味道。希望有对前端测试有经验心得的大神可以分享
希望老师讲一下,如何配置才能让自己工程每次提交代码,自动跑一遍?
在本作业中,test.js测试用例需要引用 js/list.js 和 quz/quz.js,但是我发现引用方式是配置在karma.conf.js的files里,比如
#karma.conf.js
files: [
'node_modules/should/should.js',
'js/*.js',
'quz/*.js',
'test/*.js'
],
这样存在的一个问题,就是,当项目功能模块变多,测试用例变多时,很难管理各个模块的依赖,因为我们更希望在test.js中以require('../quz/quz')
的形式来引用quz。
但是当karma模拟的是浏览器的运行环境时,采用require的语法会报错,因为浏览器不支持cjs语法。
目前想到的方法有:
方法一、 使用rollup up等工具将项目代码转化为amd(define)风格代码,然后在karma中配置karma-requirejs来支持amd语法
方法二、像本作业的模块引用方式一样,把所有依赖包全部配置在karma.conf.js的files里,此时需要把代码中的require(...)去除掉。
然后真正的项目是如何处理这个问题的呢?真正的项目应该不会采用方法二这种方式吧?
只能修改配置项为chrome
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.