'How do I test swap pair in Hardhat?

I used the factory contract to create the pair contract, how do I get an instance of the pair contract in Hardhat. Used to query the LP value of an account



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source