WEBVTT

00:03.440 --> 00:06.840
So let's create some kind of integration test for our business logic

00:07.340 --> 00:10.800
in equity management service. So let's go to the GitHub copilot,

00:11.300 --> 00:14.800
generate some tests it will be already smart enough and created

00:15.300 --> 00:18.800
based on the Chai synon and mocha instead of just by

00:19.300 --> 00:23.160
default as in the previous example. And let's accept it for now and

00:23.660 --> 00:26.000
let's see how it would be working.

00:28.240 --> 00:31.440
Still waiting a bit and then

00:31.940 --> 00:35.120
we. Would need to first thing first rename. It to from test

00:35.620 --> 00:39.120
to spec. Then we will check what is inside and

00:39.620 --> 00:43.200
we can see some issues here we would need to replace

00:43.700 --> 00:47.040
it with. Let's even have a

00:47.540 --> 00:53.020
good suggestion how to fix it Fix See

00:53.520 --> 00:56.980
what it will suggest us. Yeah, that's completely correct equity

00:57.480 --> 01:01.500
types. So then we can use it.

01:02.780 --> 01:06.140
So what I will do here I will actually remove this error and

01:06.640 --> 01:10.700
then I will change the name to error company not

01:11.200 --> 01:14.700
found because that's the string which would be passed in the message from the capitalization

01:15.200 --> 01:18.650
event here. So you will see that whenever you threw the error it it would

01:19.150 --> 01:22.650
be stringified and then it would be error in front of the error issue.

01:22.890 --> 01:26.610
And that's why here we need to put an error

01:27.110 --> 01:30.770
here. So let's also rename all

01:31.270 --> 01:36.130
other issues here to be

01:36.630 --> 01:39.930
named properly. So we still have

01:41.290 --> 01:44.660
one issue to resolve is here

01:45.160 --> 01:48.740
in the share split the copilot suggested us

01:49.240 --> 01:52.540
to also check if shareholder companies owned amount

01:53.040 --> 01:56.460
is changed and for now we'll just cut it out and that would

01:56.960 --> 02:01.060
be challenge for yourself to actually fix it. The problem lies in the implementation

02:01.380 --> 02:05.060
of the split event and also how the

02:05.140 --> 02:08.460
populate function actually work on the

02:08.960 --> 02:12.429
mongoose level. So good luck with fixing that. But for now

02:12.589 --> 02:16.229
if I remove this line all of the tests will be passing and that's how

02:16.729 --> 02:19.829
you can use unit and integration testing using GitHub

02:20.329 --> 02:20.509
Copilot.
