Git Product home page Git Product logo

Comments (3)

vors avatar vors commented on June 7, 2024

Very interesting question. It's always a compromise between what you can test and what you should mock. In the spirit of discussion PowerShell/DscResources#9 I would recommend the following:

  • Separate tests to Unit Tests and End-To-End tests.
  • Mock all API calls that can harm user machine configuration in Unit Tests.
  • Use try { Setup ... } finally { Cleanup } pattern in End-To-End, to make sure that End-To-End tests don't harm user machine configuration.

In our CI system we would run all the tests (machine would be blown away every time), but we also want enable local test runs, so it's important to cleanup everything.

from webadministrationdsc.

hahndorf avatar hahndorf commented on June 7, 2024

I decided for myself to do mostly real testing rather than mocking, because that doesn't prove anything. In huge projects mocking can be a real time saver, but I think we should really test the resources we are writing.

from webadministrationdsc.

tysonjhayes avatar tysonjhayes commented on June 7, 2024

My only suggestion here would be that you place this in the integration folder. This way people can avoid running the tests if they are worried about something breaking on their own dev machine (I run all tests every time I publish a change for example).

from webadministrationdsc.

Related Issues (20)

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.