Javascript 将代码放在Jasmine测试的正确目录中+;流星

Javascript 将代码放在Jasmine测试的正确目录中+;流星,javascript,meteor,jasmine,meteor-velocity,Javascript,Meteor,Jasmine,Meteor Velocity,我是Jasmine测试框架的新手,希望得到一些指导。在tests文件夹下,我有以下目录结构: tests/jasmine/client tests/jasmine/server 在这两个文件夹下,我有: tests/jasmine/client/integration tests/jasmine/client/unit 及 我对代码在正确文件夹中的位置感到困惑。我所有的测试都与服务器上的Meteor.methods有关。我了解,“单元”测试文件夹下的测试无法访问任何Meteor代码,需要实现

我是Jasmine测试框架的新手,希望得到一些指导。在tests文件夹下,我有以下目录结构:

tests/jasmine/client
tests/jasmine/server
在这两个文件夹下,我有:

tests/jasmine/client/integration
tests/jasmine/client/unit

我对代码在正确文件夹中的位置感到困惑。我所有的测试都与服务器上的Meteor.methods有关。我了解,“单元”测试文件夹下的测试无法访问任何Meteor代码,需要实现存根,并且客户端文件夹中的测试可以测试客户端代码(与服务器文件夹类似)。然而,这是否意味着:

  • 我对服务器Meteor.methods的所有测试都应该在服务器/集成上吗
  • 可以在客户端或服务器中测试/collections文件夹(客户端和服务器都可以访问)中的方法
    文件夹结构:

    both/ (OR lib/)          -- common code for server and client
      |- collections/        -- declare collections (e.g Employer = new Meteor.Collection("employer");)
      |- router     /        -- router code(e.g Router.route(..))
    
    client/                  -- client side code
      |- global/             -- all global variable for client
      |- helpers/            -- global helper for client (for all templates)
      |- plugins/            -- all the plugins code(if you use any)
      |- stylesheets/        -- css / less files
      |- templates/          -- all templates
            |- home.html     -- home template(html)
            |- home.js       -- home template(js)
    
    public/                  -- images/icons/fonts (meteor looking at this file)
    
    server/                  -- server code
      |- methods/            -- server methods/API (e.g Meteor.methods({...}))
      |- publish/            -- publish code from server
    
    希望这能对你有所帮助


    有关进一步的或。

    文件夹结构:

    both/ (OR lib/)          -- common code for server and client
      |- collections/        -- declare collections (e.g Employer = new Meteor.Collection("employer");)
      |- router     /        -- router code(e.g Router.route(..))
    
    client/                  -- client side code
      |- global/             -- all global variable for client
      |- helpers/            -- global helper for client (for all templates)
      |- plugins/            -- all the plugins code(if you use any)
      |- stylesheets/        -- css / less files
      |- templates/          -- all templates
            |- home.html     -- home template(html)
            |- home.js       -- home template(js)
    
    public/                  -- images/icons/fonts (meteor looking at this file)
    
    server/                  -- server code
      |- methods/            -- server methods/API (e.g Meteor.methods({...}))
      |- publish/            -- publish code from server
    
    希望这能对你有所帮助

    为了进一步或更进一步