papandreou on update
Add workaround to get the test … (compare)
papandreou on camelCase
Sketch out some basic tests Slow, naive implementation of t… Support camel case syntax withi… and 6 more (compare)
papandreou on v13.0.0
papandreou on master
Add release notes 13.0.0 (compare)
papandreou on update
papandreou on master
Update eslint-plugin-markdown t… Adjust configuration based on h… Merge pull request #820 from un… (compare)
papandreou on update
Adjust configuration based on h… (compare)
papandreou on update
Get most of the external tests … (compare)
depfu[bot] on update
Update jest to version 27.4.5 (compare)
papandreou on master
Apply the jasmine patch for 4.x… (compare)
papandreou on master
Expect jasmine to exit with 3 w… (compare)
papandreou on update
.d.ts
files by hand?
blocked-at
that uses async_hooks to also provide a stack trace of where the blocking operation was initiated. Unfortunately it has a big perf overhead, so it’s not suitable for production.
rss
is way bigger than my heapTotal
and external
memory segments combined when I inspect process.memoryUsage()
. I would expect that heapTotal
+ external
gives me all the memory used by js objects and c++ objects referenced from js. Am I missing something? Wouldn't a runaway rss
number be an indication that theres some native code leaking? I am observing up to 70 to 80 percent of memory use being outside of heap and external...
external
will only include memory that is allocated outside the JS heap and correctly reported using Isolate::AdjustAmountOfExternalAllocatedMemory
: https://v8docs.nodesource.com/node-4.8/d5/dda/classv8_1_1_isolate.html#ae1a59cac60409d3922582c4af675473emalloc
gets called.
Hello.
I am finding myself to often encounter such construct in React components:
useEffect(() => {
loadCapabilitiesAction().then(capabilityList => {
if (capabilityList) {
setCapabilities(capabilityList);
}
});
});
It's all about fetching some data and setting the state which then renders some DOM.
It's not very straightforward to test it though.
Do you have any advice or direction to follow with unexpected?
A component test looks like that
const loadCapabilitiesActionPromise = Promise.resolve([
{ id: "mailadmin", metadata: {} },
{ id: "website_builder_premium", metadata: {} },
{ id: "wordpress", metadata: {} },
{ id: "webshop", metadata: {} },
{ id: "onephoto", metadata: {} },
{ id: "filemanager", metadata: {} },
{ id: "dns", metadata: {} },
{ id: "external_ssh", metadata: {} },
{ id: "backup", metadata: {} },
{ id: "php_mysql", metadata: {} },
{ id: "guest_users", metadata: {} }
]);
props.loadCapabilitiesAction.returns(loadCapabilitiesActionPromise);
let component = null;
await act(async () => {
component = mount(<QuickAccess {...props} />);
});
loadCapabilitiesActionPromise.then(() => {
expect(component, "not to contain test id", "quick-access-website-stats");
});
but to be honest I am in an infinite loop with such an approach.
You're mixing data fetching with your view in the same component, so you'll have to stub one to test the other.
One way to fix it is to split the component in two: One component that has all the view logic and take all the data as props, and then component with no "DOM-like" components, but the data fetching and a forward to the plain view component. Both components can be exported from the same file.