React 16.8 introduced hooks, including a new test function called 'act' which helps better describe what your components do. These slides show how you can use it effectively in your code.
Stop Making Excuses and Start Testing Your JavaScriptRyan Anklam
The document provides tips for adding testing to JavaScript projects. It recommends choosing a testing environment and dialect, then setting up the tests by installing dependencies and configuring files. Common issues like testing asynchronous code and methods that call other methods can be addressed with spies, stubs, mocks and promises. Tests should focus on isolated units of code and avoid direct DOM manipulation when possible. Automating testing through build tools like Grunt and Testem helps to easily run and watch tests. Overall, the document emphasizes making testing easy by writing maintainable, modular code and setting up automation.
Firebase and ng2
This document discusses Firebase and AngularFire/AngularFire2. It summarizes that Firebase is a backend as a service that provides realtime database functionality. AngularFire/AngularFire2 are wrappers that make the Firebase API accessible to Angular applications. Key features covered include authentication, authorization, data validation, and working with data through observable references and promises. Best practices like shallow data structures and avoiding deep nesting are also highlighted.
Typescript fundamentals document summarized in 3 sentences:
The document discusses Typescript fundamentals including types, classes, interfaces, modules and how to use the Typescript compiler. It explains how Typescript adds type safety and compile time checking to JavaScript by using types for variables, parameters, returns and more. Examples are provided for many Typescript features and how they compile down to equivalent JavaScript.
Test-Driven Development of AngularJS ApplicationsFITC
The document discusses test driven development for AngularJS applications. It outlines problems with traditional front-end development approaches like jQuery manipulation and lack of structure/modularity. The solution presented uses Node.js, NPM, Bower, Grunt, Jasmine and other tools to automate tasks, add structure and enable testing. Features of an example task tracking app are developed using a test-first approach with end-to-end and unit tests. The app is built incrementally by splitting development into small features and writing tests for each.
The document discusses using HTML elements like <div> tags and JavaScript to implement drag and drop functionality in Silverlight 1.0 since user controls were not available, and provides an example of the code needed to enable drag and drop in Silverlight using event handlers to track mouse movement and position elements. It also compares the drag and drop implementation between straight JavaScript and Silverlight.
This document provides an overview of React and Redux concepts including:
- React basics like components, props, state, and lifecycle methods
- Flux architecture and how data flows through actions, dispatcher, and stores
- Redux as an alternative to Flux that uses a single store updated by reducers in response to actions
- Additional React topics like JSX, propTypes, and using React with ES6 classes are also covered.
Stop Making Excuses and Start Testing Your JavaScriptRyan Anklam
The document provides tips for adding testing to JavaScript projects. It recommends choosing a testing environment and dialect, then setting up the tests by installing dependencies and configuring files. Common issues like testing asynchronous code and methods that call other methods can be addressed with spies, stubs, mocks and promises. Tests should focus on isolated units of code and avoid direct DOM manipulation when possible. Automating testing through build tools like Grunt and Testem helps to easily run and watch tests. Overall, the document emphasizes making testing easy by writing maintainable, modular code and setting up automation.
Firebase and ng2
This document discusses Firebase and AngularFire/AngularFire2. It summarizes that Firebase is a backend as a service that provides realtime database functionality. AngularFire/AngularFire2 are wrappers that make the Firebase API accessible to Angular applications. Key features covered include authentication, authorization, data validation, and working with data through observable references and promises. Best practices like shallow data structures and avoiding deep nesting are also highlighted.
Typescript fundamentals document summarized in 3 sentences:
The document discusses Typescript fundamentals including types, classes, interfaces, modules and how to use the Typescript compiler. It explains how Typescript adds type safety and compile time checking to JavaScript by using types for variables, parameters, returns and more. Examples are provided for many Typescript features and how they compile down to equivalent JavaScript.
Test-Driven Development of AngularJS ApplicationsFITC
The document discusses test driven development for AngularJS applications. It outlines problems with traditional front-end development approaches like jQuery manipulation and lack of structure/modularity. The solution presented uses Node.js, NPM, Bower, Grunt, Jasmine and other tools to automate tasks, add structure and enable testing. Features of an example task tracking app are developed using a test-first approach with end-to-end and unit tests. The app is built incrementally by splitting development into small features and writing tests for each.
The document discusses using HTML elements like <div> tags and JavaScript to implement drag and drop functionality in Silverlight 1.0 since user controls were not available, and provides an example of the code needed to enable drag and drop in Silverlight using event handlers to track mouse movement and position elements. It also compares the drag and drop implementation between straight JavaScript and Silverlight.
This document provides an overview of React and Redux concepts including:
- React basics like components, props, state, and lifecycle methods
- Flux architecture and how data flows through actions, dispatcher, and stores
- Redux as an alternative to Flux that uses a single store updated by reducers in response to actions
- Additional React topics like JSX, propTypes, and using React with ES6 classes are also covered.
The whole workshop is open source: https://github.com/georgiee/angular-workshop-skipbo
---
Angular Advanced Workshop we gave for KaiserX (Allianz, Dec 2018) to teach advanced topics of Angular in a playful way.
The workshop covered six chapters:
Modules, Components, Routing, RxJS, Testing & Animations.
Each Chapter included a challenge, a markdown document describing step by step what to do while giving challenging tasks to solve. The challenges include git branches to catch up if someone gets lost.
We even covered advanced topics like the event loop (micro/macro tasks), zone.js, onPush, ChangeDetection & switchMap vs mergeMap. I'm so happy that I could share this knowledge and people understood it.
By following my workshop, all 15 developers created a fully working Skip-Bo game within three days. There are animations, advanced unit tests, a implemented AI called Oscar to play for the CPU opponents and so much more!
And the best part
We made everything open source. The whole workshop can be found on github: https://github.com/georgiee/angular-workshop-skipbo
Here the final result:
https://skipbo-angular-workshop.netlify.com
Technologies are ever changing and since we're building our applications on the shoulders of giants like Babel,... We have to stay up-to-date with the newest trends.
We at Codifly strongly believe in using the newest technologies, that's why we've organised a meetup to showcase these for you. This event was organised in collaboration with ITLab HoGent at Campus Schoonmeersen (Voskenslaan 270, 9000 Ghent).
A certain level of knowledge about these subjects is required since we're mostly be going over the recent changes. For Babel we're discussing what's new in their upcoming version 7, for Webpack the changes from 3 -> 4.6 will be discussed and for React all the new features in React 16.3 and the upcoming ones.
This document discusses testing in iOS applications. It begins by introducing the author and their background. It then discusses reasons for testing like reliability, regression testing, and confidence during refactoring. Potential issues with testing like heavy UI dependence and non-testable code are addressed. The document recommends separating UI and service code for better testability. It demonstrates the Kiwi and OCMock testing frameworks and provides examples of testing classes, dependencies, and private/static methods in an isolated way without heavy mocking. It emphasizes best practices like writing tests first and using version control properly.
This document discusses asynchronous JavaScript unit testing. It covers what asynchronous code is, what an async test is, and different approaches for writing async tests including callbacks, promises, generators, and async/await. It also discusses using the SinonJS library for test spies, stubs and mocks. Examples of testing async code and references for further reading are provided.
The document discusses test-driven development (TDD). It states that TDD relies on short development cycles where the developer first writes an automated test case that defines a new function or improvement. Then the developer produces code to pass that test, and refactors the new code to acceptable standards.
This talk was delivered at JavaOne 2013, together with Andrzej Grzesik. We mention the new Date APIs, changes to Collections as well as Streams APIs and of course... Lambdas!
Ember applications are built around an MVC model that prescribes Models, Views, Controllers, and Routes for managing persistence, DOM, application state, and URLs. In an ambitious enough app, that model may fail to cover the whole problem space. Fear not, for in this presentation you will learn how to use Ember’s container and dependency features to move beyond MVC, as well as learning how they tie Ember internals together.
Video: http://www.youtube.com/watch?v=iCZUKFNXA0k&feature=youtu.be&t=1h45m59s
This document provides an overview of various JavaScript concepts and techniques, including:
- Prototypal inheritance allows objects in JavaScript to inherit properties from other objects. Functions can act as objects and have a prototype property for inheritance.
- Asynchronous code execution in JavaScript is event-driven. Callbacks are assigned as event handlers to execute code when an event occurs.
- Scope and closures - variables are scoped to functions. Functions create closures where they have access to variables declared in their parent functions.
- Optimization techniques like event delegation and requestAnimationFrame can improve performance of event handlers and animations.
This document discusses callbacks, promises, and generators for handling asynchronous code in JavaScript. It begins by explaining callbacks and the issues they can cause like "callback hell". It then introduces promises as an alternative using libraries like Q that allow chaining asynchronous operations together. Generators are also covered as a way to write asynchronous code that looks synchronous when combined with promises through libraries like CO. Overall, it recommends using an asynchronous pattern supported by a library to manage complex asynchronous code.
Using React, Redux and Saga with Lottoland APIsMihail Gaberov
This document provides an agenda and overview of key concepts for ReactJS, Redux, Redux Saga, and RESTful APIs. It discusses React components and state management, Redux actions, reducers and stores, Redux Saga for managing asynchronous logic, and using the Lottoland REST API for retrieving lottery data. Code examples are provided to demonstrate React components, Redux reducers and sagas, and making API requests to retrieve login tokens and drawings.
One of JavaScript’s strengths is how it handles asynchronous code. Async is one of the most important and often misunderstood part of Javascript or any other language. Async is hard because we, as human beings, can’t do two conscious actions at once and think about both of them at the same moment. In this talk we will see how asynchronous JavaScript evolved over the years. It all started with callbacks… and it landed on generators!
This document provides an introduction and overview of React and Redux. It begins with an introduction to key React concepts like components, props, state, and the virtual DOM. It then covers Redux, including actions, reducers, stores, and using Redux with React. Other topics include React Native, server-side rendering, routing with React Router, testing, and resources for learning more. The document aims to give the high-level essential information about React and Redux.
This presentation deals with a complex approach to application testing in back end and front end parts, tests writing and common mistakes. It also includes a short overview of libraries and frameworks for creation of tests, as well as practical examples of code.
Presentation by Pavlo Iuriichuk, Lead Software Engineer, GlobalLogic, Kyiv), delivered at an open techtalk on December 11, 2014.
More details - http://globallogic.com.ua/report-web-testing-techtalk-2014
The document discusses JavaScript promises and how they can be used to handle asynchronous operations. Promises allow asynchronous functions to return values asynchronously by attaching callbacks to the promise object. This avoids callback hell and makes asynchronous code easier to read and maintain. The document covers how promises can be chained together, executed in parallel, cached, and passed around between functions. It also discusses promise implementations in different frameworks like jQuery, Angular, and how promises can interact across frameworks.
This talk was given at JSSummit 2013. Entitled "Avoiding Callback Hell with Async.js", my talk focused on common pitfalls with asynchronous functions and callbacks in JavaScript, and using the async.js library and its advanced control flows to create cleaner, more manageable code.
s React.js a library or a framework? In any case, it is a new way of working that represents a revolution in the way of building web projects. It has very particular characteristics that allow us, for instance, to render React code from the server side, or to include React components from Twig tags. During this talk we will present React.js, we will explore how to take advantage of it from PHP projects and we will give answers to practical problems such as universal (isomorphical) rendering and the generation of React.js forms from Symfony forms without duplication of efforts.
React has allowed the company to grow its development team from 1 React developer and 6 total frontend developers to 1 React developer and 40 total frontend developers over 11 months. The document discusses the learning curve for React, including an initial phase of hatred, then a phase of understanding how to properly structure applications using concepts like actions, stores, and unidirectional data flow. It emphasizes keeping components small and testable. The future of React is discussed, noting that while the framework continues to evolve and introduce changes, it does so without breaking existing code.
ReactJS is a JavaScript library for building user interfaces. It uses a virtual DOM and only updates parts of the real DOM that changed. React uses a component-based architecture where data flows unidirectionally via props and state. Lifecycle methods allow components to handle state changes. Components are built with JSX syntax and can be nested to build up an application from reusable pieces.
The whole workshop is open source: https://github.com/georgiee/angular-workshop-skipbo
---
Angular Advanced Workshop we gave for KaiserX (Allianz, Dec 2018) to teach advanced topics of Angular in a playful way.
The workshop covered six chapters:
Modules, Components, Routing, RxJS, Testing & Animations.
Each Chapter included a challenge, a markdown document describing step by step what to do while giving challenging tasks to solve. The challenges include git branches to catch up if someone gets lost.
We even covered advanced topics like the event loop (micro/macro tasks), zone.js, onPush, ChangeDetection & switchMap vs mergeMap. I'm so happy that I could share this knowledge and people understood it.
By following my workshop, all 15 developers created a fully working Skip-Bo game within three days. There are animations, advanced unit tests, a implemented AI called Oscar to play for the CPU opponents and so much more!
And the best part
We made everything open source. The whole workshop can be found on github: https://github.com/georgiee/angular-workshop-skipbo
Here the final result:
https://skipbo-angular-workshop.netlify.com
Technologies are ever changing and since we're building our applications on the shoulders of giants like Babel,... We have to stay up-to-date with the newest trends.
We at Codifly strongly believe in using the newest technologies, that's why we've organised a meetup to showcase these for you. This event was organised in collaboration with ITLab HoGent at Campus Schoonmeersen (Voskenslaan 270, 9000 Ghent).
A certain level of knowledge about these subjects is required since we're mostly be going over the recent changes. For Babel we're discussing what's new in their upcoming version 7, for Webpack the changes from 3 -> 4.6 will be discussed and for React all the new features in React 16.3 and the upcoming ones.
This document discusses testing in iOS applications. It begins by introducing the author and their background. It then discusses reasons for testing like reliability, regression testing, and confidence during refactoring. Potential issues with testing like heavy UI dependence and non-testable code are addressed. The document recommends separating UI and service code for better testability. It demonstrates the Kiwi and OCMock testing frameworks and provides examples of testing classes, dependencies, and private/static methods in an isolated way without heavy mocking. It emphasizes best practices like writing tests first and using version control properly.
This document discusses asynchronous JavaScript unit testing. It covers what asynchronous code is, what an async test is, and different approaches for writing async tests including callbacks, promises, generators, and async/await. It also discusses using the SinonJS library for test spies, stubs and mocks. Examples of testing async code and references for further reading are provided.
The document discusses test-driven development (TDD). It states that TDD relies on short development cycles where the developer first writes an automated test case that defines a new function or improvement. Then the developer produces code to pass that test, and refactors the new code to acceptable standards.
This talk was delivered at JavaOne 2013, together with Andrzej Grzesik. We mention the new Date APIs, changes to Collections as well as Streams APIs and of course... Lambdas!
Ember applications are built around an MVC model that prescribes Models, Views, Controllers, and Routes for managing persistence, DOM, application state, and URLs. In an ambitious enough app, that model may fail to cover the whole problem space. Fear not, for in this presentation you will learn how to use Ember’s container and dependency features to move beyond MVC, as well as learning how they tie Ember internals together.
Video: http://www.youtube.com/watch?v=iCZUKFNXA0k&feature=youtu.be&t=1h45m59s
This document provides an overview of various JavaScript concepts and techniques, including:
- Prototypal inheritance allows objects in JavaScript to inherit properties from other objects. Functions can act as objects and have a prototype property for inheritance.
- Asynchronous code execution in JavaScript is event-driven. Callbacks are assigned as event handlers to execute code when an event occurs.
- Scope and closures - variables are scoped to functions. Functions create closures where they have access to variables declared in their parent functions.
- Optimization techniques like event delegation and requestAnimationFrame can improve performance of event handlers and animations.
This document discusses callbacks, promises, and generators for handling asynchronous code in JavaScript. It begins by explaining callbacks and the issues they can cause like "callback hell". It then introduces promises as an alternative using libraries like Q that allow chaining asynchronous operations together. Generators are also covered as a way to write asynchronous code that looks synchronous when combined with promises through libraries like CO. Overall, it recommends using an asynchronous pattern supported by a library to manage complex asynchronous code.
Using React, Redux and Saga with Lottoland APIsMihail Gaberov
This document provides an agenda and overview of key concepts for ReactJS, Redux, Redux Saga, and RESTful APIs. It discusses React components and state management, Redux actions, reducers and stores, Redux Saga for managing asynchronous logic, and using the Lottoland REST API for retrieving lottery data. Code examples are provided to demonstrate React components, Redux reducers and sagas, and making API requests to retrieve login tokens and drawings.
One of JavaScript’s strengths is how it handles asynchronous code. Async is one of the most important and often misunderstood part of Javascript or any other language. Async is hard because we, as human beings, can’t do two conscious actions at once and think about both of them at the same moment. In this talk we will see how asynchronous JavaScript evolved over the years. It all started with callbacks… and it landed on generators!
This document provides an introduction and overview of React and Redux. It begins with an introduction to key React concepts like components, props, state, and the virtual DOM. It then covers Redux, including actions, reducers, stores, and using Redux with React. Other topics include React Native, server-side rendering, routing with React Router, testing, and resources for learning more. The document aims to give the high-level essential information about React and Redux.
This presentation deals with a complex approach to application testing in back end and front end parts, tests writing and common mistakes. It also includes a short overview of libraries and frameworks for creation of tests, as well as practical examples of code.
Presentation by Pavlo Iuriichuk, Lead Software Engineer, GlobalLogic, Kyiv), delivered at an open techtalk on December 11, 2014.
More details - http://globallogic.com.ua/report-web-testing-techtalk-2014
The document discusses JavaScript promises and how they can be used to handle asynchronous operations. Promises allow asynchronous functions to return values asynchronously by attaching callbacks to the promise object. This avoids callback hell and makes asynchronous code easier to read and maintain. The document covers how promises can be chained together, executed in parallel, cached, and passed around between functions. It also discusses promise implementations in different frameworks like jQuery, Angular, and how promises can interact across frameworks.
This talk was given at JSSummit 2013. Entitled "Avoiding Callback Hell with Async.js", my talk focused on common pitfalls with asynchronous functions and callbacks in JavaScript, and using the async.js library and its advanced control flows to create cleaner, more manageable code.
s React.js a library or a framework? In any case, it is a new way of working that represents a revolution in the way of building web projects. It has very particular characteristics that allow us, for instance, to render React code from the server side, or to include React components from Twig tags. During this talk we will present React.js, we will explore how to take advantage of it from PHP projects and we will give answers to practical problems such as universal (isomorphical) rendering and the generation of React.js forms from Symfony forms without duplication of efforts.
React has allowed the company to grow its development team from 1 React developer and 6 total frontend developers to 1 React developer and 40 total frontend developers over 11 months. The document discusses the learning curve for React, including an initial phase of hatred, then a phase of understanding how to properly structure applications using concepts like actions, stores, and unidirectional data flow. It emphasizes keeping components small and testable. The future of React is discussed, noting that while the framework continues to evolve and introduce changes, it does so without breaking existing code.
ReactJS is a JavaScript library for building user interfaces. It uses a virtual DOM and only updates parts of the real DOM that changed. React uses a component-based architecture where data flows unidirectionally via props and state. Lifecycle methods allow components to handle state changes. Components are built with JSX syntax and can be nested to build up an application from reusable pieces.
This document discusses Angular resolvers, which are used to pre-fetch data before navigating to a component. Angular resolvers implement the Resolve interface to return data via Observable or Promise before the route is activated. An example is provided demonstrating how to create a resolver service to fetch product data from an API, configure routes to use the resolver, and access the resolved data in a component. A loading spinner is also added to improve the user experience while data is loading.
A brief introduction to javascript test driven development (TDD) towards several point of views by using qUnit, Karma & Jasmine, NodeJS tape module and custom frameworks.
NestJS (https://nestjs.com/) is a Node.js framework for building server-side applications. This slide give you a brief introduction of Nest, and shows the examples like Service, Middleware, and Pipe, etc.
Rhino Mocks is a .NET mocking framework that allows developers to easily create and setup mock objects to test interactions using unit tests. It generates both mocks, which allow expectations to be set and verified, and stubs, which simply return preset values without verification. The document provides examples of using Rhino Mocks to generate mocks and stubs of interfaces, set expectations on mocks, and verify mock interactions using the AAA (Arrange, Act, Assert) syntax. It also distinguishes between mocks and stubs.
Unit testing and end-to-end (E2E) testing are important types of automated testing for JavaScript applications. Unit tests focus on testing individual functions or components in isolation to catch bugs, while E2E tests ensure that user flows work as expected by interacting with the application through a browser. The presentation discussed setting up testing frameworks like Karma and Jasmine for unit testing and Protractor for E2E testing. It also covered writing testable code, handling dependencies through dependency injection, and selecting elements and interacting with them during E2E tests.
Adding a modern twist to legacy web applicationsJeff Durta
Avoid misery of working with legacy code
We will see how you can add independent and isolated components to existing pages; pages that may be difficult to change
React and Flux allow you to make self-contained additions that handle their own data access/persistence
Sharing code in between react components by using render props. HOC and react prop are some of the best ways to share code in react class components.
#hoc #react #renderprop
This document provides an agenda for an introduction to jQuery and jQuery UI. It begins with an overview of selectors, events, traversing, effects & animations, and Ajax in jQuery. It then discusses what jQuery is, its history, advantages over vanilla JavaScript, examples, and the noConflict() method. Next, it covers various selectors, traversing methods, filters, and events. The document concludes with discussions of manipulating HTML and CSS, animations, jQuery's Ajax methods, and integrating jQuery UI.
React is a JavaScript framework used for building user interfaces. It uses components as the building blocks for user interfaces and embraces functional programming principles like immutable data and pure functions. The key aspects of React include JSX which allows writing HTML in JavaScript files, components which are functions that output HTML, and hooks which allow components to interact with state and lifecycle events.
Good karma: UX Patterns and Unit Testing in Angular with KarmaExoLeaders.com
The document discusses unit testing in Angular with Karma. It provides examples of UX patterns in Angular like binding elements to variables, lists, and click handlers. It also covers what controllers and scopes are and examples of testing components in Angular like services, factories, and UI elements. Hands-on examples are provided for setting up a test environment and writing tests.
This document provides an overview and comparison of different approaches for building mobile applications, including native and hybrid approaches. It discusses React Native specifically and its advantages, such as allowing developers to build mobile apps for Android and iOS using React with a single codebase, while still providing access to native platform features and a native user experience. It also covers topics like navigation, testing, publishing apps, and some challenges with React Native like dealing with JavaScript errors in production.
AngularJs $provide API internals & circular dependency problem.Yan Yankowski
The document provides an overview of AngularJS dependency injection and the $provide service. It explains the differences between providers, factories, services, values, constants, and decorators. It describes how $provide registers these items in the providerCache and instanceCache and instantiates them lazily through the $injector. Circular dependencies can cause errors since items point to each other before being fully instantiated.
Building an angular application -1 ( API: Golang, Database: Postgres) v1.0Frost
The document provides instructions for building an Angular application with a Golang API and PostgreSQL database. It includes steps to set up the Angular and API projects, configure services and routing in Angular, and build components for item purchase, display, and reporting. The Angular app uses the Golang API to perform CRUD operations on a PostgreSQL database and display the data.
This document provides an introduction to React, including what React is, its history and timeline, common front-end development tasks it addresses, and its core fundamentals like JSX, functional programming principles, and components. It discusses React hooks like useState and useEffect, building a React project, and integrating third-party libraries. The workshop will cover topics like creating a new React app, building a component hierarchy for a todo list application, and using the key property for dynamic lists.
react-slides.pdf gives information about react libraryjanet736113
React is a framework that employs Webpack to automatically compile React, JSX, and ES6 code while handling CSS file prefixes. React is a JavaScript-based UI development library. Although React is a library rather than a language, it is widely used in web development. The library first appeared in May 2013 and is now one of the most commonly used frontend libraries for web development.
React offers various extensions for entire application architectural support, such as Flux and React Native, beyond mere UI,When compared to other technologies on the market, React is a new technology. Jordan Walke, a software engineer at Facebook, founded the library in 2011, giving it life. The likes of XHP, a straightforward HTML component framework for PHP, have an influence on React. React's newsfeed was its debut application in 2011. Later, Instagram picks it up and incorporates it into their platform,
Advantages
Makes use of the JavaScript structure known as virtual DOM. Since JavaScript's virtual DOM is quicker than the conventional DOM, this will boost the speed of programs.
Can be used with various systems and on both client and server sides is commendable.
Components and identify trends make larger apps easier to manage by increasing clarity.
Limitations
Only addresses the app's angle and distance; as a result, additional techniques must be selected if you want a full collection of development tools.
Employs inline scripting and JSX, which some programmers might find uncomfortable.
A talk I gave at Montreal React Native Meetup (August Edition)
This talks is dedicated to Reactotron, a debugging desktop application that tightly integrate with React and Redux as well as providing nice debugging goodies like network inspection, async storage inspection, screenshot, overlay and more.
The outline of the talk is:
What is it?
How does it work?
What it can do for you?
* Redux State Management
* Reporting & Logging
* Networking
* Miscellaneous
Slides include presenter notes.
Similar to Testing React hooks with the new act function (20)
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIVladimir Iglovikov, Ph.D.
Presented by Vladimir Iglovikov:
- https://www.linkedin.com/in/iglovikov/
- https://x.com/viglovikov
- https://www.instagram.com/ternaus/
This presentation delves into the journey of Albumentations.ai, a highly successful open-source library for data augmentation.
Created out of a necessity for superior performance in Kaggle competitions, Albumentations has grown to become a widely used tool among data scientists and machine learning practitioners.
This case study covers various aspects, including:
People: The contributors and community that have supported Albumentations.
Metrics: The success indicators such as downloads, daily active users, GitHub stars, and financial contributions.
Challenges: The hurdles in monetizing open-source projects and measuring user engagement.
Development Practices: Best practices for creating, maintaining, and scaling open-source libraries, including code hygiene, CI/CD, and fast iteration.
Community Building: Strategies for making adoption easy, iterating quickly, and fostering a vibrant, engaged community.
Marketing: Both online and offline marketing tactics, focusing on real, impactful interactions and collaborations.
Mental Health: Maintaining balance and not feeling pressured by user demands.
Key insights include the importance of automation, making the adoption process seamless, and leveraging offline interactions for marketing. The presentation also emphasizes the need for continuous small improvements and building a friendly, inclusive community that contributes to the project's growth.
Vladimir Iglovikov brings his extensive experience as a Kaggle Grandmaster, ex-Staff ML Engineer at Lyft, sharing valuable lessons and practical advice for anyone looking to enhance the adoption of their open-source projects.
Explore more about Albumentations and join the community at:
GitHub: https://github.com/albumentations-team/albumentations
Website: https://albumentations.ai/
LinkedIn: https://www.linkedin.com/company/100504475
Twitter: https://x.com/albumentations
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Speck&Tech
ABSTRACT: A prima vista, un mattoncino Lego e la backdoor XZ potrebbero avere in comune il fatto di essere entrambi blocchi di costruzione, o dipendenze di progetti creativi e software. La realtà è che un mattoncino Lego e il caso della backdoor XZ hanno molto di più di tutto ciò in comune.
Partecipate alla presentazione per immergervi in una storia di interoperabilità, standard e formati aperti, per poi discutere del ruolo importante che i contributori hanno in una comunità open source sostenibile.
BIO: Sostenitrice del software libero e dei formati standard e aperti. È stata un membro attivo dei progetti Fedora e openSUSE e ha co-fondato l'Associazione LibreItalia dove è stata coinvolta in diversi eventi, migrazioni e formazione relativi a LibreOffice. In precedenza ha lavorato a migrazioni e corsi di formazione su LibreOffice per diverse amministrazioni pubbliche e privati. Da gennaio 2020 lavora in SUSE come Software Release Engineer per Uyuni e SUSE Manager e quando non segue la sua passione per i computer e per Geeko coltiva la sua curiosità per l'astronomia (da cui deriva il suo nickname deneb_alpha).
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
20 Comprehensive Checklist of Designing and Developing a WebsitePixlogix Infotech
Dive into the world of Website Designing and Developing with Pixlogix! Looking to create a stunning online presence? Look no further! Our comprehensive checklist covers everything you need to know to craft a website that stands out. From user-friendly design to seamless functionality, we've got you covered. Don't miss out on this invaluable resource! Check out our checklist now at Pixlogix and start your journey towards a captivating online presence today.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
“An Outlook of the Ongoing and Future Relationship between Blockchain Technologies and Process-aware Information Systems.” Invited talk at the joint workshop on Blockchain for Information Systems (BC4IS) and Blockchain for Trusted Data Sharing (B4TDS), co-located with with the 36th International Conference on Advanced Information Systems Engineering (CAiSE), 3 June 2024, Limassol, Cyprus.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
2. Testing React hooks with ‘act’ @d_ir
• Independent software consultant
• aka a contractor
• I’m a generalist / polyglot. Currently doing Ruby on Rails
for Idean
• I care a lot about quality, people, TDD
• I organise Queer Code London
Hello! I’m Daniel
3. Testing React hooks with ‘act’ @d_ir
• React 16.8 introduced hooks, including the useEffect
hook which is used for running side effects in your
component, just like componentDidMount would have
done.
• If you write tests that instrument the useEffect hook, you’ll
get a warning when you run tests about using act.
• That’s because React prefers guard-rail driven
development and it wants to warn you about ‘better’
ways to do things
The story so far… (1 of 2)
4. Testing React hooks with ‘act’ @d_ir
• What we used to do flushing promises should now be
done by using act.
• There are two forms of act: sync and async. Async is for
side effects. The sync form batches up calls to setState
which forces a specific class of errors (that you probably
won’t run into often).
• Async act is absolutely necessary to get rid of warnings
but you’ll need to use the alpha release of React 16.9 to
use it.
The story so far… (2 of 2)
5. Testing React hooks with ‘act’ @d_ir
export class AppointmentFormLoader extends React.Component {
constructor(props) {
super(props);
this.state = { availableTimeSlots: [] }
}
async componentDidMount() {
const result = await window.fetch('/availableTimeSlots', {
method: 'GET',
credentials: 'same-origin',
headers: { 'Content-Type': 'application/json' }
})
this.setState({
availableTimeSlots: await result.json()
})
}
render() { ... }
}
Using
cDM to
fetch
data
7. Testing React hooks with ‘act’ @d_ir
• A spy should always use at least two tests:
1. One test to assert the parameter values that are
passed
2. One test to check the return value is used correctly
Using spies to test dependencies
9. Testing React hooks with ‘act’ @d_ir
import React from 'react';
import ReactDOM from 'react-dom';
import 'whatwg-fetch';
import { AppointmentFormLoader } from '../src/
AppointmentFormLoader';
describe('AppointmentFormLoader', () => {
let container;
beforeEach(() => {
container = document.createElement('div');
jest.spyOn(window, 'fetch');
});
it('fetches data when component is mounted', () => {
ReactDOM.render(<AppointmentFormLoader />, container);
expect(window.fetch).toHaveBeenCalledWith(
'/availableTimeSlots',
expect.objectContaining({
method: 'GET',
credentials: 'same-origin',
headers: { 'Content-Type': 'application/json' }
})
);
});
});
Testing a
fetch call,
pre hooks
10. Testing React hooks with ‘act’ @d_ir
● AppointmentFormLoader › fetches data when
component is mounted
expect(jest.fn()).toHaveBeenCalledWith(expected)
Expected mock function to have been called with:
["/availableTimeSlots", ObjectContaining
{"credentials": "same-origin", "headers":
{"Content-Type": "application/json"}, "method":
"GET"}]
But it was not called.
Running the
previous test
in React
16.8…
One solution is to use the useLayoutEffect hook instead, but...
11. Testing React hooks with ‘act’ @d_ir
it('fetches data when component is mounted', async () => {
ReactDOM.render(<AppointmentFormLoader />, container);
await new Promise(setTimeout);
expect(window.fetch).toHaveBeenCalledWith(
'/availableTimeSlots',
expect.objectContaining({
method: 'GET',
credentials: 'same-origin',
headers: { 'Content-Type': 'application/json' }
})
);
});
Flushing promises
12. Testing React hooks with ‘act’ @d_ir
console.error node_modules/react-dom/cjs/react-dom.development.js:
546
Warning: An update to AppointmentFormLoader inside a test was not
wrapped in act(...).
When testing, code that causes React state updates should be
wrapped into act(...):
act(() => {
/* fire events that update state */
});
/* assert on the output */
This ensures that you're testing the behavior the user would see
in the browser. Learn more at https://fb.me/react-wrap-tests-with-act
in AppointmentFormLoader
But... guard rails
13. Testing React hooks with ‘act’ @d_ir
import { act } from 'react-dom/test-utils';
it('fetches data when component is mounted', () => {
act(() => {
ReactDOM.render(<AppointmentFormLoader />, container);
});
expect(window.fetch).toHaveBeenCalledWith(...);
});
Using act for the previous tests, in React 16.8
The test passes! But unfortunately, this doesn't fix the warning...
14. Testing React hooks with ‘act’ @d_ir
it('fetches data when component is mounted', async () => {
await act(async () => {
ReactDOM.render(<AppointmentFormLoader />, container);
});
expect(window.fetch).toHaveBeenCalledWith(...);
});
Using act for the previous tests, in React 16.9
To suppress the warning we have to use the async version of act.
The sync version still produces the warning
15. Testing React hooks with ‘act’ @d_ir
export const App = () => {
let [counter, setCounter] = useState(0);
return <button onClick={() => setCounter(counter + 1)}
>{counter}</button>;
}
it("should increment a counter", () => {
// we attach the element to document.body to ensure
events work
document.body.appendChild(container);
ReactDOM.render(<App />, container);
const button = container.childNodes[0];
for (let i = 0; i < 3; i++) {
button.dispatchEvent(new MouseEvent(
"click", { bubbles: true }));
}
expect(button.innerHTML).toBe("3");
});
So what
is sync
act
useful
for?
(1 of 2)
Adapted from https://github.com/threepointone/react-act-examples
16. Testing React hooks with ‘act’ @d_ir
act(() => {
for (let i = 0; i < 3; i++) {
button.dispatchEvent(new MouseEvent(
"click", { bubbles: true }));
}
});
expect(button.innerHTML).toBe(3);
// this fails, it's actually "1"!
So what
is sync
act
useful
for?
(2 of 2)
Adapted from https://github.com/threepointone/react-act-examples
18. Testing React hooks with ‘act’ @d_ir
describe('submitting indicator', () => {
it('displays indicator when form is submitting', async () => {
ReactDOM.render(
<CustomerForm {...validCustomer} />, container);
act(() => {
ReactTestUtils.Simulate.submit(form('customer'));
});
await act(async () => {
expect(element('span.submittingIndicator')).not.toBeNull();
});
});
});
The first test
This ensures the expectation executes before your fetch call
19. Testing React hooks with ‘act’ @d_ir
describe('submitting indicator', () => {
it('initially does not display the submitting indicator', () => {
ReactDOM.render(<CustomerForm {...validCustomer} />, container);
expect(element('.submittingIndicator')).toBeNull();
});
it('hides indicator when form has submitted', async () => {
ReactDOM.render(<CustomerForm {...validCustomer} />, container);
await act(async () => {
ReactTestUtils.Simulate.submit(form('customer'));
});
expect(element('.submittingIndicator')).toBeNull();
});
});
The second and third tests
20. Testing React hooks with ‘act’ @d_ir
• Async act (React 16.9.0-alpha.0) is needed whenever
your tests have side effects (e.g. call fetch, animation etc)
• Sync act is used to batch up state mutations to ensure
that you use the updater form of your tests
• But that relies on you always using act
• Testing libraries like Enzyme and react-testing-library are
still building in support for act.
• But you shouldn’t be afraid of rolling your own.
Recap
21. Testing React hooks with ‘act’ @d_ir
• Write lots of short tests that test very small things
• Testing dependencies with spies always requires at least
two tests
• Use arrange-act-assert form for your tests
• If your tests are hard to write, that's a sign that your
production code can be simplified
Some tips for writing better tests
22. Testing React hooks with ‘act’ @d_ir
My book is available on Amazon or
on packtpub.com.
496 pages of sheer goodness,
teaching TDD from the ground up.
It covers this plus much more,
including testing animation using
the same useEffect technique.
Or get in contact:
Email daniel@conciselycrafted.com
Twitter @d_ir
Want to learn more?
23. Testing React hooks with ‘act’ @d_ir
Slides will be online soon--I'll tweet them
Or get in contact:
Email daniel@conciselycrafted.com
Twitter @d_ir
Thanks!