I am a J1 visa holder with resident alien status for 2018 tax year. is my J-2 dependent spouse a resident alien or is a non-resident alien for 2018 tax year?

i am a J1 visa holder and entered usa in 2016. my spouse entered usa in 2017 on J-2 status. I am a resident alien for 2018 tax year. so does my spouse automatically become a resident alien or are they a non-resident alien for 2018 tax year and can opt to file a joint return with me as a resident aliend?