GithubHelp home page GithubHelp logo

homework1's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

homework1's Issues

对象引用相关问题

虽然作业测试是通过的,但是感觉自己没有特别理解对象引用之间的关系。
两个测试用例同样都是引用的传过来的对象的地址,可是为什么第一个改变原对象,第二个却没有改变原对象。

数据结构和算法

希望老师可以出一个学习数据结构和算法的清单,就类似于我们每节课的预习清单一样,给一个数据结构和算法的清单,包括推荐的书籍,文档,博客都可以。

目前完成情况

  • 大家都完成的不错
  • 很多同学没做边界检验,比如传入的到底是不是List的实例,start和len到底是否超出范围
  • coverage 做的最好的应该是 #11 ,对 karma coverage 有问题的同学可以看看这个issue

跪求大佬分享

跪求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(...)去除掉。

然后真正的项目是如何处理这个问题的呢?真正的项目应该不会采用方法二这种方式吧?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.