'AssertionError: expected [Function] to equal 'EthSwap Instant Exchange'
I am doing a tutorial on the web and I ran into an error while trying to run a truffle test. I am not sure where I am going wrong or what to do in this event.
Code:
contract('EthSwap', (accounts) => {
describe('EthSwap deployment', async () => {
it('contract has a name', async () => {
let ethSwap = await EthSwap.new()
const name = await ethSwap.name
assert.equal(name, 'EthSwap Instant Exchange')
})
})
})
This is the error I am getting when I run the test:
AssertionError: expected [Function] to equal 'EthSwap Instant Exchange'
Any help is greatly appreciated. This may be a very silly question but I am new at this. Thanks. Just a note that I went much further than this stage before and have gotten this code to work before in different scenarios before I ran into a big problem where things became so complicated that I decided to roll back. Now I am having problems that I didn't encounter before at this simple stage in the project.
Solution 1:[1]
It is not a problem here in this file. It is problem in your EthSwap.sol file wherein the string variable name you have written
incorrect - "EthSwap instant Exchange"
correct - "EthSwap Instant Exchange"
I think it will help you.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | SONU SHARMA |