为什么这崩溃了,我该如何解决?

I have 2 tables called contacts and producers. In order to add data to my contacts table, first I need to have an existing producer. The producers table contains only ProducerID and ProducerName columns. The contacts table contains a few more columns such as ProducerID, ProducerWebsite, ProducerEmail, ProducerNumber and ProducerAddress. Here is the code to create the contacts table and to add data to it:

    constructor(dbName = ':memory:') {
    return (async() => {
        this.db = await sqlite.open(dbName)
        const sql = 'CREATE TABLE IF NOT EXISTS contacts(ProducerID INTEGER, ProducerWebsite TEXT, ProducerEmail TEXT, ProducerNumber INTEGER, ProducerAddress TEXT)'
        await this.db.run(sql)
        return this
    })()
}

async addContacts (ProducerName, ProducerWebsite, ProducerEmail, ProducerNumber, ProducerAddress){
    if(isNaN(Number.parseInt(ProducerNumber))) throw new Error('The Producer Number cannot contain letters')
    let sql = `INSERT INTO contacts (ProducerID, ProducerWebsite, ProducerEmail, ProducerNumber, ProducerAddress) VALUES (
        (SELECT TOP 1 ProducerID FROM producers WHERE ProducerName="${ProducerName}"), 
        ProducerWebsite="${ProducerWebsite}", ProducerEmail="${ProducerEmail}", ProducerNumber="${ProducerNumber}", ProducerAddress="${ProducerAddress}" 
    )`
}

And when I try to test it in Jest it gives me a reference error saying that sql is not defined under the addContacts function. Here is also the Jest Unit Test for reference:

    
'use strict'

const Contacts = require('../modules/contacts.js')
const Producers = require('../modules/producers.js')


describe ('Add contact information()' , () => {

    test('Add contacts', async done => {
        expect.assertions(1)
        const producer = await new Producers()
        await producer.addProducer('James')
        const verdata = await producer.getAll()
        await expect (verdata.length).toBe(1)
        const contact = await new Contacts()
        await contact.addContacts('James', 'www.johnwick.com', 'john@johnwick.com', '0882503714', '24, John Wick Street, Coventry, UK')
        const data = await contact.getAll()
        await expect (data.length).toBe(1)
        expect (data[0].ProducerID).toBe(1)
        expect (data[0].ProducerWebsite).toBe('www.johnwick.com')
        expect (data[0].ProducerEmail).toBe('john@johnwick.com')
        expect (data[0].ProducerNumber).toBe('0882503714')
        expect (data[0].ProducerAddress).toBe('24, John Wick Street, Coventry, UK')
        done()
    })

})