- Jan 2024
-
mongoosejs.com mongoosejs.com
-
Instance methods Instances of Models are documents. Documents have many of their own built-in instance methods. We may also define our own custom document instance methods. // define a schema const animalSchema = new Schema({ name: String, type: String }, { // Assign a function to the "methods" object of our animalSchema through schema options. // By following this approach, there is no need to create a separate TS type to define the type of the instance functions. methods: { findSimilarTypes(cb) { return mongoose.model('Animal').find({ type: this.type }, cb); } } }); // Or, assign a function to the "methods" object of our animalSchema animalSchema.methods.findSimilarTypes = function(cb) { return mongoose.model('Animal').find({ type: this.type }, cb); }; Now all of our animal instances have a findSimilarTypes method available to them. const Animal = mongoose.model('Animal', animalSchema); const dog = new Animal({ type: 'dog' }); dog.findSimilarTypes((err, dogs) => { console.log(dogs); // woof }); Overwriting a default mongoose document method may lead to unpredictable results. See this for more details. The example above uses the Schema.methods object directly to save an instance method. You can also use the Schema.method() helper as described here. Do not declare methods using ES6 arrow functions (=>). Arrow functions explicitly prevent binding this, so your method will not have access to the document and the above examples will not work.
Certainly! Let's break down the provided code snippets:
1. What is it and why is it used?
In Mongoose, a schema is a blueprint for defining the structure of documents within a collection. When you define a schema, you can also attach methods to it. These methods become instance methods, meaning they are available on the individual documents (instances) created from that schema.
Instance methods are useful for encapsulating functionality related to a specific document or model instance. They allow you to define custom behavior that can be executed on a specific document. In the given example, the
findSimilarTypes
method is added to instances of theAnimal
model, making it easy to find other animals of the same type.2. Syntax:
Using
methods
object directly in the schema options:javascript const animalSchema = new Schema( { name: String, type: String }, { methods: { findSimilarTypes(cb) { return mongoose.model('Animal').find({ type: this.type }, cb); } } } );
Using
methods
object directly in the schema:javascript animalSchema.methods.findSimilarTypes = function(cb) { return mongoose.model('Animal').find({ type: this.type }, cb); };
Using
Schema.method()
helper:javascript animalSchema.method('findSimilarTypes', function(cb) { return mongoose.model('Animal').find({ type: this.type }, cb); });
3. Explanation in Simple Words with Examples:
Why it's Used:
Imagine you have a collection of animals in your database, and you want to find other animals of the same type. Instead of writing the same logic repeatedly, you can define a method that can be called on each animal instance to find similar types. This helps in keeping your code DRY (Don't Repeat Yourself) and makes it easier to maintain.
Example:
```javascript const mongoose = require('mongoose'); const { Schema } = mongoose;
// Define a schema with a custom instance method const animalSchema = new Schema({ name: String, type: String });
// Add a custom instance method to find similar types animalSchema.methods.findSimilarTypes = function(cb) { return mongoose.model('Animal').find({ type: this.type }, cb); };
// Create the Animal model using the schema const Animal = mongoose.model('Animal', animalSchema);
// Create an instance of Animal const dog = new Animal({ type: 'dog', name: 'Buddy' });
// Use the custom method to find similar types dog.findSimilarTypes((err, similarAnimals) => { console.log(similarAnimals); }); ```
In this example,
findSimilarTypes
is a custom instance method added to theAnimal
schema. When you create an instance of theAnimal
model (e.g., a dog), you can then callfindSimilarTypes
on that instance to find other animals with the same type. The method uses thethis.type
property, which refers to the type of the current animal instance. This allows you to easily reuse the logic for finding similar types across different instances of theAnimal
model.
Tags
Annotators
URL
-
-
github.com github.com
-
[Yomitan - The Moe Way]
site:: [[GitHub]] user:: themoeway url:: https://github.com/themoeway/yomitan accessed:: 2024-01-04
-
- Nov 2023
-
github.com github.com
-
But I do question why lib and not something in app is the common suggestion for classes/modules who do not fall into the default set of folders (models, controllers, jobs, etc). Is it just because it's what we've been doing for so long? To me feels like we're trying to shoehorn the lib folder into further being a kitchen sink (now holding rake tasks and miscellaneous classes), rather than just saying "your Ruby classes/modules go somewhere in app because they're application code".
-
-
-
-
for: Deep Humanity, epoche, BEing journey, Douglas Harding, Zen, emptiness, awakening, the Headless Way
-
summary
- adjacency between
- Kensho
- Zen
- Douglas Harding's Headless Way
-
adjacency statement
- this paper explores the parallels between Zen b experienced of Kensho and Douglas Harding's Headless Way
-
question
- can this technique be adapted for Deep Humanity BEing journeys and mass awakening /epoche?
-
-
- Jul 2023
-
en.wikipedia.org en.wikipedia.org
-
The "Dokkōdō" (Japanese: 獨行道) ("The Path of Aloneness", "The Way to Go Forth Alone", or "The Way of Walking Alone") is a short work written by Miyamoto Musashi a week before he died in 1645. It consists of 21 precepts. "Dokkodo" was largely composed on the occasion of Musashi giving away his possessions in preparation for death, and was dedicated to his favorite disciple, Terao Magonojō (to whom the earlier Go rin no sho [The Book of Five Rings] had also been dedicated), who took them to heart. "Dokkōdō" expresses a stringent, honest, and ascetic view of life.
The work of Musashi, Dokkodo, is the Japanese for "The way of walking alone", which I like most as a translation.
-
-
docdrop.org docdrop.org
-
no we don't
-
Answer
- No.
- we end up with a non conceptual insight that:
- we can then communicate
- that we can discuss
- that we can articulate
- that requires that reason be present at:
- the beginning like the seed
- in the middle when we're performing the analysis
- like the rain that nourishes the crops and
- in the end in the harvest
- because non conceptuality is really easy to achieve all you need is a very large rock,
- just bang right on your head and non conceptuality is there
- but that's a mute inert non-conceptual
- Non-conceptuality needs to be enriched by the conceptual insight that allows you to actually make something of it
-
The Middle Way
- using the conceptual to reach a deeper appreciation of the state of non-conceptuality,
- in other words, using dualistic thought and language to reach insights about the nondual
-
-
- Title
- Madhyamaka: Jay Garfield
- Description
- Jay Garfield talks about why Nagarjuna's technique employts reason to undermine itself to achieve peace in a nonconceptual state.
- He humorously points out how its easy to achieve nonconceptual states in many ways, such as a large rock to the head, but that kind of nonconceptual state is not really insightful for penetrating the deep philosophical questions we all have.
- He clarifies why Nagarjuna's process is called the Middle Way,
- it employs (conceptual) analysis to achieve wisdom of the nondual (nonconceptual) state
- Jay Garfield talks about why Nagarjuna's technique employts reason to undermine itself to achieve peace in a nonconceptual state.
- Title
-
- Nov 2022
-
www.eastgate.com www.eastgate.com
-
How Large Is A Note?
Looks like this eternal question is addressed in The Tinderbox Way.
-
-
www.suffix.be www.suffix.be
-
So far for the obligatory warning. I get the point, I even agree with the argument, but I still want to send a POST request. Maybe you are testing an API without a user interface or you are writing router tests? Is it really impossible to simulate a POST request with Capybara? Nah, of course not!
-
- Aug 2022
-
stackoverflow.com stackoverflow.com
-
It's a great way to test various limits. When you think about this even more, it's a little mind-bending, as we're trying to impose a global clock ("who is the most up to date") on a system that inherently doesn't have a global clock. When we scale time down to nanoseconds, this affects us in the real world of today: a light-nanosecond is not very far.
-
- Jul 2022
-
danallosso.substack.com danallosso.substack.com
-
It's annotations all the way down...
-
-
github.com github.com
-
Interestingly, Rails doesn't see this in their test suite because they set this value during setup:
-
- Nov 2021
-
stackoverflow.com stackoverflow.com
-
Stores are the idiomatic Svelte way when you need to import "reactivity" from your normal JS sources.
-
-
hcommons.org hcommons.org
-
I know I know with the Paris is it is a stone. And people used to write on stone in Egypt. And that’s where they would create their hieroglyphic alphabet.
-
-
www.varvet.com www.varvet.com
-
I am firmly convinced that asserting on the state of the interface is in every way superior to asserting on the state of your model objects in a full-stack test.
-
- Oct 2021
-
guides.rubyonrails.org guides.rubyonrails.org
-
Inflections go the other way around.In classic mode, given a missing constant Rails underscores its name and performs a file lookup. On the other hand, zeitwerk mode checks first the file system, and camelizes file names to know the constant those files are expected to define.While in common names these operations match, if acronyms or custom inflection rules are configured, they may not. For example, by default "HTMLParser".underscore is "html_parser", and "html_parser".camelize is "HtmlParser".
-
- Sep 2021
-
www.npmjs.com www.npmjs.com
-
The more your tests resemble the way your software is used, the more confidence they can give you.
-
- Aug 2021
-
-
Now consider we want to handle numbers in our known value set: const KNOWN_VALUES = Object.freeze(['a', 'b', 'c', 1, 2, 3]) function isKnownValue(input?: string | number) { return typeof(input) === 'string' && KNOWN_VALUES.includes(input) } Uh oh! This TypeScript compiles without errors, but it's not correct. Where as our original "naive" approach would have worked just fine. Why is that? Where is the breakdown here? It's because TypeScript's type system got in the way of the developer's initial intent. It caused us to change our code from what we intended to what it allowed. It was never the developer's intention to check that input was a string and a known value; the developer simply wanted to check whether input was a known value - but wasn't permitted to do so.
-
- Jun 2021
-
hypothes.is hypothes.is
-
"Although in the United States it is common to use the term multiculturalism to refer to both liberal forms of multiculturalism and to describe critical multicultural pedagogies, in Canada, Great Britain, Australia, and other areas,anti-racism refers to those enactments of multiculturalism grounded in critical theory and pedagogy. The term anti-racism makes a greater distinction, in my opinion, between the liberal and critical paradigms of multiculturalism, and is one of the reasons I find the anti-racism literature useful for analyzing multiculturalism in music education."
-
-
github.com github.com
-
There are many projects that does not use the master branch as default. For example, Next.js uses the canary branch, the npm CLI and many more other projects uses stuff like prod, production, dev, develop, release, beta, head.
-
-
docs.gitlab.com docs.gitlab.com
-
targeting what the user actually sees
-
The most important guideline to give is the following: Write clean unit tests if there is actual value in testing a complex piece of logic in isolation to prevent it from breaking in the future Otherwise, try to write your specs as close to the user’s flow as possible
-
It’s better to test a component in the way the user interacts with it: checking the rendered template.
-
- May 2021
-
github.com github.com
-
or simply install the package to devDependencies rather than dependencies, which will cause it to get bundled (and therefore compiled) with your app:
-
- Apr 2021
-
medium.com medium.com
-
“Who cares? Let’s just go with the style-guide” — to which my response is that caring about the details is in the heart of much of our doings. Yes, this is not a major issue; def self.method is not even a code smell. Actually, that whole debate is on the verge of being incidental. Yet the learning process and the gained knowledge involved in understanding each choice is alone worth the discussion. Furthermore, I believe that the class << self notation echoes a better, more stable understanding of Ruby and Object Orientation in Ruby. Lastly, remember that style-guides may change or be altered (carefully, though!).
-
- Mar 2021
-
www.jackfranklin.co.uk www.jackfranklin.co.uk
-
This isn't really a downside to React; one of React's strengths is that it lets you control so much and slot React into your environment
-
Svelte is different in that by default most of your code is only going to run once; a console.log('foo') line in a component will only run when that component is first rendered.
Tags
- important point
- difference
- allowing developer/user to pick and choose which pieces to use (allowing use with competing libraries; not being too opinionated; not forcing recommended way on you)
- opinion
- Svelte vs. React
- reasonable defaults
- opinionated
- flexibility to use the tool that you prefer
- unfortunate defaults
- trying to doing things the same way you did in a different library/framework (learning new way of thinking about something / overcoming habits/patterns/paradigms you are accustomed to)
- turning things around / doing it differently
Annotators
URL
-
-
github.com github.com
-
we want source maps in production (like DHH)
-
I totally understand that there may be a majority still considering this a bad practice and thus keeping it disabled by default in production seem ok. But there could at least be an option to enable it for people who want to, no?
-
After waiting years for sprockets to support this we were very happy to see that sprockets 4 officially added support (thanks ), but then when trying to upgrade we noticed there's actually no way to use it in production... (without brittle hacks mentioned above).
Tags
- the needs/wishes of a minority
- reasonable defaults
- can be disabled by default but at least provide a way to opt in if needed
- rails: the Rails way
- sad/unfortunate conclusion
- official preferred convention / way to do something
- best practices
- unfortunate
- irony
- missing configuration option or way to customize this behavior
Annotators
URL
-
-
-
Rails still encourages you to dump all validation errors at the top of a form, which is lulzy in this age of touchy UX
-
-
afarkas.github.io afarkas.github.ioWebshim1
-
Webshim is opinionated, that a developer should always solve a problem the HTML5 way.
-
-
trailblazer.to trailblazer.to
-
In production, you will never trigger one specific callback or a particular validation, only. Your application will run all code required to create a Song object, for instance. In Trailblazer, this means running the Song::Create operation, and testing that very operation with all its side-effects.
-
There’s no need to test controllers, models, service objects, etc. in isolation
-
Run the complete unit with a certain input set, and test the side-effects. This differs to the Rails Way™ testing style, where smaller units of code, such as a specific validation or a callback, are tested in complete isolation. While that might look tempting and clean, it will create a test environment that is not identical to what happens in production.
Tags
- isolation (programming)
- testing: philosohy of testing
- testing: tests should resemble the way your software is used
- rails: the Rails way
- unnecessary
- testing: test the side effects
- testing: avoid testing implementation details
- testing: avoid unnecessarily testing things in too much isolation, in a different way than the code is actually used (should match production)
- the Trailblazer way
Annotators
URL
-
-
trailblazer.to trailblazer.to
-
Instead of one big code pile, activities will gently enforce a clean, standardized way for organizing code.
-
the Activity component is the heart of TRB
-
- Feb 2021
-
www.schneems.com www.schneems.com
-
Have you ever felt like a framework was getting in the way instead of helping you go faster? Maybe you’re stuck on some simple task that would be easy to do manually, but your framework is making you jump through configuration hoops. I end up getting lost in a sea of documentation (or no documentation), and the search for that one magical config key takes just a tad bit too long. It’s a productivity sink, and worse than the time delay it adds to my frustration throughout the day.
-
-
-
I'm not a fan of listing exceptions functions can throw, especially here in Python, where it's easier to ask forgiveness than permission.
-
-
trailblazer.to trailblazer.to
-
In other words: the controllers usually contain only routing and rendering code and dispatch instantly to a particular operation/activity class.
-
-
github.com github.com
-
Instead of dealing with a mix of before_filters, Rack-middlewares, controller code and callbacks, an endpoint is just another activity and allows to be customized with the well-established Trailblazer mechanics.
-
-
trailblazer.to trailblazer.to
-
Endpoint is the missing link between your routing (Rails, Hanami, …) and the “operation” to be called. It provides standard behavior for all cases 404, 401, 403, etc and lets you hook in your own logic like Devise or Tyrant authentication, again, using TRB activity mechanics.
-
What this means is: I better refrain from writing a new book and we rather focus on more and better docs.
I'm glad. I didn't like that the book (which is essentially a form of documentation/tutorial) was proprietary.
I think it's better to make documentation and tutorials be community-driven free content
-
To make it short: we returned to the Rails Way™, lowering our heads in shame, and adhere to the Rails file and class naming structure for operations.
-
There is nothing wrong with building your own “service layer”, and many companies have left the Traiblazer track in the past years due to problems they had and that we think we now fixed.
Tags
- shift in preference
- non-free content
- welcome/good change
- free content
- trailblazer-endpoint
- focus on the user
- admit the limitations/shortcomings of your argument/benefits
- documentation
- software preferences are personal
- knowledge commons (information/data/content)
- annotation meta: inherit same annotation/tags
- Trailblazer
- the missing link
- community-driven development
- more than one right way (no one right/best way)
- I'm glad they did it this way
- rails: the Rails way
- I agree
- finally / at last
- funny
- recant/retract/revert/withdraw your previous plans
- the Trailblazer way
Annotators
URL
-
-
github.com github.com
-
In Trailblazer, models are completely empty. They solely contain associations and finders. No business logic is allowed in models.
-
While Trailblazer offers you abstraction layers for all aspects of Ruby On Rails, it does not missionize you. Wherever you want, you may fall back to the "Rails Way" with fat models, monolithic controllers, global helpers, etc. This is not a bad thing, but allows you to step-wise introduce Trailblazer's encapsulation in your app without having to rewrite it.
Tags
- models: should be thin, dealing with persistence/associations only, not business logic
- abstractions
- focus on what it should do, not on how it should do it (implementation details; software design)
- allowing developer/user to pick and choose which pieces to use (allowing use with competing libraries; not being too opinionated; not forcing recommended way on you)
- leaving the details of implementation/integration up to you
- making changes / switching/migrating gradually/incrementally/step-wise/iteratively
- newer/better ways of doing things
- rails: the Rails way
- Trailblazer
- focus on concepts/design/structure instead of specific/concrete technology/implementation
- the Trailblazer way
- freedom of user to override specific decision of an authority/vendor (software)
Annotators
URL
-
-
-
In Ruby 3 we now have a “rightward assignment” operator. This flips the script and lets you write an expression before assigning it to a variable. So instead of x = :y, you can write :y => x
-
-
github.com github.com
-
This is a breaking change so it'll have to go into a major release. I was working on a v4 release but it's too much. I think I'm going to pair it back and we can add this to the new v4. When I have that ready, I'll rebase the merge onto that branch.
-
-
stoa.anagora.org stoa.anagora.orgUntitled1
-
The Timeless Way of Building is the first in a series of books which describe an entirely new attitude to architec- ture and planning. The books are intended to provide a complete working alternative to our present ideas about ar- chitecture, building, and planning—~an alternative which will, we hope, gradually replace current ideas and practices,
[[the timeless way of building]]
-
- Jan 2021
-
blog.linuxmint.com blog.linuxmint.com
-
We don’t do politics, and we certainly don’t do religion. You’re bringing these here by using terms such as “politicians” or “evil”.
Does "evil" refer to religion? Or perhaps they meant "evil" in a more general way, as a more extreme version of "bad".
-
-
www.donielsmith.com www.donielsmith.com
-
Depending on what other component libraries you’ve used, you may be used to handling events by passing callback functions to component properties, or using a special event syntax – Svelte supports both, though one is usually more appropriate than the other depending on your situation. This post explains both ways.
-
-
discourse.ubuntu.com discourse.ubuntu.com
-
Adding layer of settings and complexity for the end user might also bring bad practices to keep a comfortable use of app’s by installing snap without confinement…
-
- Dec 2020
-
github.com github.com
-
Jbuilder gives you a simple DSL for declaring JSON structures that beats manipulating giant hash structures. This is particularly helpful when the generation process is fraught with conditionals and loops.
-
-
github.com github.com
-
I think the main difference between the two are the way API are served. Some smelte components need you to input big chunk of json as props, while i prefer keep props as primitive types and in the other hand give you different components tags to compose.
-
- Nov 2020
-
github.com github.com
-
There are a few intentional behavioral differences between Dart Sass and Ruby Sass. These are generally places where Ruby Sass has an undesired behavior, and it's substantially easier to implement the correct behavior than it would be to implement compatible behavior. These should all have tracking bugs against Ruby Sass to update the reference behavior.
Tags
- learn from your mistakes
- reversible decisions
- intentionally doing it differently / _not_ emulating/copying the way someone else did it
- don't let previous decisions/work constrain you
- reference implementation
- get back on course
- intentional
- intentional/well-considered decisions
- reverting a previous decision/change/commit
Annotators
URL
-
-
Local file Local file
-
You’ll learn how to cause stack overflows, illegal memory access, andother common flaws that plague C programs so that you know what you’re upagainst
When you learn from "Learn C the Hard Way"
-
- Oct 2020
-
stackoverflow.com stackoverflow.com
-
If you have a better/simpler/"more official" solution, I'd still love to see it!
The "official" solution is to use submitErrors (see Erik's answer).
-
-
medium.com medium.com
-
Modules from the following layer can require anything from all the previous layers, but not vice versa.
-
-
www.npmjs.com www.npmjs.comhyperx1
-
http://facebook.github.io/jsx/#why-not-template-literals (respectfully disagree)
-
-
medium.com medium.com
-
Svelte chooses a reverse approach.
-
-
github.com github.com
-
Svelte doesn't re-render, so you need to respond to component mount/dismount and prop changes separately as they are distinct concepts and never tied together, unlike in React.
-
While react hooks were one of the catalysts for v3 we don't agree with with the APIs or the model and won't be emulating it.
Tags
- UI library: reacting to prop changes
- different way of thinking about something
- lifecycle callbacks
- react hooks
- intentionally doing it differently / _not_ emulating/copying the way someone else did it
- official opinion/stance/position
- distinction
- Svelte
- intentional/well-considered decisions
- trying to doing things the same way you did in a different library/framework (learning new way of thinking about something / overcoming habits/patterns/paradigms you are accustomed to)
Annotators
URL
-
-
medium.com medium.com
-
Sometimes, you may be tempted to write that wrapper. Because all your (React or Vue or insert your reactive framework here) instincts tell you so.Resist the temptation. There is a better way. A svelter way. Introducing: the use-directive (a.k.a. “actions”).
-
However, especially when starting out, it’s very easy to fall into the “this is how I did things in my previous framework” trap.
Tags
- different way of thinking about something
- getting a fresh perspective
- Svelte: action (use:)
- overcoming preconceived opinions
- Svelte
- paradigm shift
- trying to doing things the same way you did in a different library/framework (learning new way of thinking about something / overcoming habits/patterns/paradigms you are accustomed to)
Annotators
URL
-
-
dylanvann.com dylanvann.com
-
Disclaimer: I’m new to Svelte so this isn’t so much a recommendation as it is a “I guess this is a way to do it 🤷♂️”
-
-
-
But maybe this PR should still be merged until he finds time for that?
Tags
- iterative process
- pull request stalled
- don't let big plans/goals get in the way of integrating/releasing smaller changes/improvements
- not a blocker (issue dependency)
- waiting for maintainers to review / merge pull request / give feedback
- big change/rewrite vs. continuous improvements / smaller refactorings
- open-source software: progress seems slow
Annotators
URL
-
- Sep 2020
-
github.com github.com
-
I think Svelte's approach where it replaces component instances with the component markup is vastly superior to Angular and the other frameworks. It gives the developer more control over what the DOM structure looks like at runtime—which means better performance and fewer CSS headaches, and also allows the developer to create very powerful recursive components.
-
-
docs.google.com docs.google.com
-
I’ve seen some version of this conversation happen more times than I can remember. And someone will always say ‘it’s because you’re too used to thinking in the old way, you just need to start thinking in hooks’.
But after seeing a lot of really bad hooks code, I’m starting to think it’s not that simple — that there’s something deeper going on.
-
- Aug 2020
-
unix.meta.stackexchange.com unix.meta.stackexchange.com
-
I went against the grain, applying other tools that people have written over the years to directly perform the job at hand which do not involve entering a program for awk or a shell to run, with answers like https://unix.stackexchange.com/a/574309/5132 and https://unix.stackexchange.com/a/578242/5132 . Others have done similar. https://unix.stackexchange.com/a/584274/5132 and https://unix.stackexchange.com/a/569600/5132 are (for examples) answers that show alternative tools to answers employing shell script and (yet again) awk programs, namely John A. Kunze's jot and rs (reshape), which have been around since 4.2BSD for goodness' sake!
-
- Jul 2020
-
-
The carefully crafted Medium story can give the appearance that- at the nadir of your professional life- you are above it all, you are concerned about others, and you are a soulful human being moving on to an even more lucrative future.
-
- May 2020
-
en.wikipedia.org en.wikipedia.org
-
In natural languages, some apparent tautologies may have non-tautological meanings in practice. In English, "it is what it is" is used to mean 'there is no way of changing it'.[1] In Tamil, vantaalum varuvaan literally means 'if he comes, he will come', but really means 'he just may come'.[2]
-
- Apr 2020
-
www.troyhunt.com www.troyhunt.com
-
many organisations block torrents (for obvious reasons) and I know, for example, that either of these options would have posed insurmountable hurdles at my previous employment
-
Actually, I probably would have ended up just paying for it myself due to the procurement challenges of even a single-digit dollar amount, but let's not get me started on that
-
- Nov 2019
-
kentcdodds.com kentcdodds.com
-
"The more your tests resemble the way your software is used, the more confidence they can give you. "
-
-
testing-library.com testing-library.com
-
You want to write maintainable tests for your React components. As a part of this goal, you want your tests to avoid including implementation details of your components and rather focus on making your tests give you the confidence for which they are intended. As part of this, you want your testbase to be maintainable in the long run so refactors of your components (changes to implementation but not functionality) don't break your tests and slow you and your team down.
-
We try to only expose methods and utilities that encourage you to write tests that closely resemble how your web pages are used.
-
The more your tests resemble the way your software is used, the more confidence they can give you.
-
Most of the damaging features have to do with encouraging testing implementation details. Primarily, these are shallow rendering, APIs which allow selecting rendered elements by component constructors, and APIs which allow you to get and interact with component instances (and their state/properties) (most of enzyme's wrapper APIs allow this).
-
- Dec 2016
-
gateway.ipfs.io gateway.ipfs.io
-
Living The Way of Knowledge BUILDING THE FOUNDATION FOR BECOMING A MAN OR WOMAN OF KNOWLEDGE IN AN EMERGING WORLD
Living The Way of Knowledge is the New Message Teaching on how to bring the grace, the guidance and the power of Knowledge into the Four Pillars of your life: The Pillar of Relationships, The Pillar of Work, The Pillar of Health and The Pillar of Spiritual Development. Like the four legs of a table, the Four Pillars provide the stable foundation for building a greater life in an unstable and uncertain world. Living The Way of Knowledge presents one of the great practices in learning and living the New Message from God. By building the Four Pillars of your life, you develop a true foundation and a greater certainty, stability and direction in your experience. It is the great wisdom in Living The Way of Knowledge that will provide the day-to-day insight needed as you pass through the great thresholds on the journey of discovering and following Knowledge.
-