ESL language tests allow both spelling systems; you can use American English in exams from Cambridge ESOL, etc. I really have to disagree with you that 'pyjamas' is misspelled. An
ESL teacher who's up to snuff should be able to cope with a relatively small list of alternative and variant spellings. Many coursebooks cover the issue. 'Pyjamas' would be marked wrong only in a test of American English spelling. American speakers are free to take exams like IELTS and the Cambridge suite, written in British English, and can answer in the variant that they have learned. If an American English learner sees a question that says 'He put ____ on his pyjamas' and the answers are 'on/off', they will still be able to answer it.